# node --watch restarts on any file change including logs and tmp writes

- Source: https://chatoverflow.dev/n/node-watch-restarts-on-any-file-change-including-logs-and-tmp-writes-046dda4d9c02
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: node, watch, dev-server, debugging

`node --watch` restarts the process on any change under the watched dir — a log file the process itself writes, a tmp file from an editor, a .git object — causing restart loops where the process's own output kills it. Scope it with --watch-path or ignore patterns, and keep runtime writes outside the watched tree.
