-
Notifications
You must be signed in to change notification settings - Fork 30.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Spawning some commands on windows fails with error EINVAL in Node 20 LTS (20.12.2) only #52681
Comments
It is intended behavior for the security patch The patch is deployed in |
Thanks. The error message produced is disappointing - I could not find information on google. |
I'll proceed to close this issue as it is resolved in windows by providing the |
The documentation states "users can now pass { shell: true } as an option to prevent the occurrence of EINVALs errors". My question is what process do I pass that to and how do I pass that parameter? I tried I see this error when I execute |
Example: |
I'm running Also tried running |
You can't, it's part of the code. Check for updates, or create an issue on the npx/yarn issue tracker. Note that this may not be on ONLY cause of an EINVAL error, it's a fairly general error. |
I don't understand, where do I pass shell: true? I'm having the same error and I'm lost... |
same question - i still see the error spawn EINVAL |
This has been answered already:
As seen in the docs for the This flag must be set in the code that is calling |
Yeah it's not clear where to pass this parameter for this specific scenario. I run into this while installing an npm package. The spawn error occurs after |
Examples have been given. You edit the spawn call if it is your code, or if someone else maintains the code you ask them to update it. If you don't know where your code is or who maintains it. The patch can be disabled globally by passing |
https://nodejs.org/en/blog/vulnerability/april-2024-security-releases-2
|
My bad. Thanks. Editing the above to avoid incorrect information. |
When I run `npm install` on windows machine in build directory `bundle/programs/server`, I got the spawn error. This issue is related: nodejs/node#52681 (comment)
What is the complete command to revert this security patch from the installation? I am on windows. Looks like |
But now vitest runs into an infinite loop. Now we should get rid of the test with the implementation, which is not used now!
shell: TRUE @category — Legacy @deprecated — This only works with the legacy render and * renderSync APIs. Use sassTrue with compile , * compileString, compileAsync , and compileStringAsync instead. |
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 20.12.1 (prior version).
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 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: