Skip to content

Commit 2f36f8e

Browse files
juanibebnb
authored andcommitted
doc: clarify behavior of --watch-path and --watch flags
Fixes: #58113 PR-URL: #58136 Reviewed-By: Juan José Arboleda <[email protected]> Reviewed-By: Tierney Cyren <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ulises Gascón <[email protected]> Co-authored-by: Tierney Cyren <[email protected]>
1 parent 7c3883c commit 2f36f8e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

doc/api/cli.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3057,6 +3057,10 @@ Use `--watch-path` to specify what paths to watch.
30573057
This flag cannot be combined with
30583058
`--check`, `--eval`, `--interactive`, or the REPL.
30593059

3060+
Note: The `--watch` flag requires a file path as an argument and is incompatible
3061+
with `--run` or inline script input, as `--run` takes precedence and ignores watch
3062+
mode. If no file is provided, Node.js will exit with status code `9`.
3063+
30603064
```bash
30613065
node --watch index.js
30623066
```
@@ -3082,6 +3086,9 @@ combination with `--watch`.
30823086
This flag cannot be combined with
30833087
`--check`, `--eval`, `--interactive`, `--test`, or the REPL.
30843088

3089+
Note: Using `--watch-path` implicitly enables `--watch`, which requires a file path
3090+
and is incompatible with `--run`, as `--run` takes precedence and ignores watch mode.
3091+
30853092
```bash
30863093
node --watch-path=./src --watch-path=./tests index.js
30873094
```

0 commit comments

Comments
 (0)