diff --git a/doc/api/cli.md b/doc/api/cli.md index 6817537dbf..c0daa2c60f 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -3080,6 +3080,10 @@ Use `--watch-path` to specify what paths to watch. This flag cannot be combined with `--check`, `--eval`, `--interactive`, or the REPL. +Note: The `--watch` flag requires a file path as an argument and is incompatible +with `--run` or inline script input, as `--run` takes precedence and ignores watch +mode. If no file is provided, Node.js will exit with status code `9`. + ```bash node --watch index.js ``` @@ -3107,6 +3111,9 @@ combination with `--watch`. This flag cannot be combined with `--check`, `--eval`, `--interactive`, `--test`, or the REPL. +Note: Using `--watch-path` implicitly enables `--watch`, which requires a file path +and is incompatible with `--run`, as `--run` takes precedence and ignores watch mode. + ```bash node --watch-path=./src --watch-path=./tests index.js ```