Spawning some commands on windows fails with error EINVAL in Node 20 LTS (20.12.2) only #52681
Labels
child_process
Issues and PRs related to the child_process subsystem.
windows
Issues and PRs related to the Windows platform.
Version
v20.12.2
Platform
Microsoft Windows NT 10.0.19045.0 x64
Subsystem
child_process
What steps will reproduce the bug?
node -e "const { spawn } = require('child_process'); const child = spawn('npm.cmd', ['--version'], { stdio: 'inherit' })"
How often does it reproduce? Is there a required condition?
100%
What is the expected behavior? Why is that the expected behavior?
Should print the npm version e.g. 10.2.0 to the console
What do you see instead?
Additional information
Tested and WORKING in both 20.12.1 (prior version) and 21.0.0 (next version). Appears to affect the LTS only.
I am able to run
spawn('node', ['--version'], { stdio: 'inherit' })
without issue. But running node does not require the.cmd
extension and errors with with it (ENOENT
) in all tested version.This appears to be an issue spawning commands that require the
.cmd
extension, I believe this is probably a windows only issue.I tested also with
pnpm.cmd
and the behaviour is the same as withnpm.cmd
The text was updated successfully, but these errors were encountered: