npm-watch icon indicating copy to clipboard operation
npm-watch copied to clipboard

Error: spawn EINVAL on Windows & Node.js v21.7.3

Open hinstw opened this issue 10 months ago • 0 comments

npm-watch no longer works on Windows after the latest security update related to cmd.exe

Related information: https://github.com/nodejs/node/issues/52554

C:\Dev\myproject>npm run watch

> [email protected] watch
> npx npm-watch

No task specified. Will go through all possible tasks
node:internal/child_process:421
    throw new ErrnoException(err, 'spawn');
    ^

Error: spawn EINVAL
    at ChildProcess.spawn (node:internal/child_process:421:11)
    at spawn (node:child_process:761:9)
    at startScript (C:\Dev\myproject\node_modules\npm-watch\watch-package.js:164:36)
    at C:\Dev\myproject\node_modules\npm-watch\watch-package.js:74:5
    at Array.forEach (<anonymous>)
    at watchPackage (C:\Dev\myproject\node_modules\npm-watch\watch-package.js:70:26)
    at Object.<anonymous> (C:\Dev\myproject\node_modules\npm-watch\cli.js:10:15)
    at Module._compile (node:internal/modules/cjs/loader:1368:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1426:10)
    at Module.load (node:internal/modules/cjs/loader:1205:32) {
  errno: -4071,
  code: 'EINVAL',
  syscall: 'spawn'
}

Node.js v21.7.3

hinstw avatar Apr 24 '24 10:04 hinstw