M-Zuber / npm-watch

run npm scripts when files change
MIT License
323 stars 38 forks source link

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

Closed hinstw closed 4 months ago

hinstw commented 4 months ago

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

> myproject@1.0.0 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