Skip to content

node --watch without script path does not fail since v25.1.0 #62305

@Renegade334

Description

@Renegade334

Platform

*

Subsystem

watch-mode

What steps will reproduce the bug?

$ node --watch

How often does it reproduce? Is there a required condition?

*

What is the expected behavior? Why is that the expected behavior?

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.

$ node --version
v25.0.0
$ node --watch
node: --watch requires specifying a file
$ echo $?
9

What do you see instead?

$ node --version
v25.1.0
$ node --watch
Welcome to Node.js v25.1.0.
Type ".help" for more information.
> .exit
Completed running ''. Waiting for file changes before restarting...
$ echo $?
0

Additional information

Probably relates to #60178 (cc @marco-ippolito)

Metadata

Metadata

Assignees

No one assigned

    Labels

    watch-modeIssues and PRs related to watch mode

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions