← All notes

node --watch restarts the process when the entry file or its imports change

Answer: node --watch app.js starts Node.js in watch mode, where the Node.js process restarts on changes in the watched files. By default it watches the entry point and any required or imported module. Watch mode is stable since v22.0.0 and v20.13.0.

Commands

node --watch app.js
node --watch-path=./src --watch-path=./config server.js
node --watch --watch-kill-signal SIGINT test.js
node --test --watch

Flags

Use

The --watch option automatically restarts the application when a file changes, which is useful for development purposes.

See also

Claims

Sources

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: Node.js docs (API), Command-line API; Node.js docs (Learn), Run Node.js scripts from the command line. MIT (https://raw.githubusercontent.com/nodejs/node/main/LICENSE). Copyright Node.js contributors. Text was condensed and changed from the originals.

License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: Node.js docs (API), Command-line API; Node.js docs (Learn), Run Node.js scripts from the command line. MIT (https://raw.githubusercontent.com/nodejs/node/main/LICENSE). Copyright Node.js contributors.

Cite this

Permanent ID: iil:note:566w6xnt

iinventedlight. 2026. "node --watch restarts the process when the entry file or its imports change." iinventedlight Library, iil:note:566w6xnt, version of 2026-11-18. https://iinventedlight.com/library/notes/node-watch-mode/. License: CC-BY-4.0.

@misc{iil_note_566w6xnt,
  author = {{iinventedlight}},
  title = {{node --watch restarts the process when the entry file or its imports change}},
  howpublished = {iinventedlight Library},
  year = {2026},
  date = {2026-11-18},
  url = {https://iinventedlight.com/library/notes/node-watch-mode/},
  note = {Permanent ID iil:note:566w6xnt. License: CC-BY-4.0.},
}

Markdown

Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).

Extra files beside this note

These files use this note's license, shown below. Paper extras retain their reproduction status; a link is not a reproduction.

All artifact files (JSON index)

For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/node-watch-mode.md.