diff --git a/doc/api/cli.md b/doc/api/cli.md index 61a047e5ac159f..ce6786a1785aff 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -3056,6 +3056,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 ``` @@ -3083,6 +3087,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 ```