Skip to main content
GoodFirstPicks
DashboardIssuesReposLeaderboard

GoodFirstPicks by Leaveitblank © 2026

CreatorRequest a RepoPrivacy PolicyTerms of Service
--watch should monitor replaced files | GoodFirstPicks

--watch should monitor replaced files

nodejs/node 9 comments 1mo ago
View on GitHub
highopenScope: somewhat clearSkill match: noNode.jsJavaScript

Why this is a good first issue

This issue requires deep knowledge of libuv and cross-platform file watching behavior.

AI Summary

The issue involves modifying Node.js's `--watch` behavior to handle file replacements correctly, particularly in Docker environments. This likely requires changes in libuv, which is a low-level library, and involves cross-platform considerations. The complexity and required domain knowledge make this a challenging issue for most contributors.

Issue Description

What is the problem this feature will solve?

Currently, --watch watches an inode and not necessarily what the user might consider a "file". This can cause confusion on systems that write to disk by deleting the old file and then creating a new one.

For example, when using Docker Compose's watch mode, the watched file is first deleted. When a new file is created Node currently fails to restart on file changes, as node is still watching the inode of the deleted file, and doesn't react to the new file being created.

What is the feature you are proposing to solve the problem?

While this behavior makes sense for the lower-level and more "raw" fs.watch(), perhaps the more general --watch behavior can be expanded to be smarter about detecting replaced files. Alternatively, a new flag can be introduced with this behavior.

What alternatives have you considered?

Other alternatives require using one of the different file watcher libs. That seems like a step down from the otherwise awesome native watch feature.

Docker Compose Issue: [BUG] Compose Watch With “node –watch” Only Reloads First Time Docker Issue: node --watch doesn't work well within a container

GitHub Labels

feature requestwatch-mode

Want to work on this?

Claim this issue to let others know you're working on it. You'll earn 10 points when you complete it!

Risk Flags

  • requires libuv changes
  • cross-platform implications
  • potential edge cases
Loading labels...

Details

Points10 pts
Difficultyhigh
Scopesomewhat clear
Skill Matchno
Test Focusedno