Skip to content

watch: fix missing file error when --watch used without argument#64088

Open
Anshikakalpana wants to merge 1 commit into
nodejs:mainfrom
Anshikakalpana:fix-watch-mode-no-file
Open

watch: fix missing file error when --watch used without argument#64088
Anshikakalpana wants to merge 1 commit into
nodejs:mainfrom
Anshikakalpana:fix-watch-mode-no-file

Conversation

@Anshikakalpana

Copy link
Copy Markdown
Contributor

Fixes #62305

Running node --watch without a file argument previously started the REPL instead of exiting with an error.

This PR restores the expected behavior by adding an explicit check in watch_mode.js immediately after markBootstrapComplete(). If no file argument is provided (process.argv[1] is falsy), the error message is printed to stderr and the process exits with code 9.

@nodejs-github-bot nodejs-github-bot added the needs-ci PRs that need a full CI run. label Jun 23, 2026
Signed-off-by: anshikakalpana <anshikajain196872@gmail.com>
@Anshikakalpana Anshikakalpana force-pushed the fix-watch-mode-no-file branch from f206782 to bd87d0d Compare June 23, 2026 09:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants