Skip to content

Commit 0d3e1b3

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 f5ac35e commit 0d3e1b3

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
@@ -3080,6 +3080,10 @@ Use `--watch-path` to specify what paths to watch.
30803080
This flag cannot be combined with
30813081
`--check`, `--eval`, `--interactive`, or the REPL.
30823082

3083+
Note: The `--watch` flag requires a file path as an argument and is incompatible
3084+
with `--run` or inline script input, as `--run` takes precedence and ignores watch
3085+
mode. If no file is provided, Node.js will exit with status code `9`.
3086+
30833087
```bash
30843088
node --watch index.js
30853089
```
@@ -3107,6 +3111,9 @@ combination with `--watch`.
31073111
This flag cannot be combined with
31083112
`--check`, `--eval`, `--interactive`, `--test`, or the REPL.
31093113

3114+
Note: Using `--watch-path` implicitly enables `--watch`, which requires a file path
3115+
and is incompatible with `--run`, as `--run` takes precedence and ignores watch mode.
3116+
31103117
```bash
31113118
node --watch-path=./src --watch-path=./tests index.js
31123119
```

0 commit comments

Comments
 (0)