Skip to content

spawn fails with error -4071 on watch command #1451

@edokan

Description

@edokan

Describe the bug
npm run watch fails on Node v22.14.0 and npm v10.9.2 under Windows. A console.log in watch-cli.js reveals the issue is in the spawn call, which fails with -4071 error per https://nodejs.org/en/blog/vulnerability/april-2024-security-releases-2

To Reproduce
Steps to reproduce the behavior:

  1. Use Node v18, v20, or v22
  2. Run npm run watch
  3. Observe that it fails with an invalid code error. Call stack contains process.exit(code)

Expected behavior
Run without issues

Version:

  • OS w/ version: Windows 11 24H2 Build 26100.6899
  • Browser w/ version: Google Chrome 141.0.7390.123
  • Node version: 22.14.0
  • npm version: 10.9.2

Additional context, screenshots, screencasts
I fixed it with a {shell: true} option, and I'll send a PR for that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions