Skip to content
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

Fix use of spawn on windows with cmd files #4652

Merged
merged 1 commit into from Apr 11, 2024
Merged

Conversation

knolleary
Copy link
Member

Following the 18.20.2/20.12.2 node.js releases, it is no longer valid to call child_process.spawn with a .cmd or .bat file without using the shell: true option.

This PR updates our usage to include the shell option when appropriate.

It's hard to know exactly what impact this could have given the many and varied ways the exec node is used - so will need some testing to verify.

Copy link
Contributor

@Steve-Mcl Steve-Mcl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved after extensive testing.

Did have an issue with uninstallation but suspect it was "my problem"

for the record, I uninstalled all binary contrib modules, updated npm to latest npm -g install npm@latest and restarted all node processes.

@Steve-Mcl Steve-Mcl merged commit 4709eb9 into master Apr 11, 2024
4 checks passed
@Steve-Mcl Steve-Mcl deleted the fix-windows-spawn branch April 11, 2024 16:51
pengx17 added a commit to toeverything/AFFiNE that referenced this pull request Apr 16, 2024
a workaround for spawn EINVAL error.
Found this issue according to node-red/node-red#4652

~~In our case the electron app is spawned by playwright. I am still investigating the issue but don't know how long it takes.~~

Upstream fix: microsoft/playwright#30382
fannheyward added a commit to neoclide/coc.nvim that referenced this pull request Apr 19, 2024
Closes neoclide/coc-prettier#178

Latest version of Node.js needs to set `shell: true` to spawn option

- node-red/node-red#4652
- microsoft/rushstack#4637
fannheyward added a commit to neoclide/coc.nvim that referenced this pull request Apr 19, 2024
Closes neoclide/coc-prettier#178

Latest version of Node.js needs to set `shell: true` to spawn option

- node-red/node-red#4652
- microsoft/rushstack#4637
StephenWeatherford added a commit to Azure/bicep that referenced this pull request Apr 19, 2024
Caused by a bug in node 18 and 20 which were caused by recent security
fixes, see node-red/node-red#4652. Short
version, it's no longer valid to use spawnSync without"shell:true".
###### Microsoft Reviewers: [Open in
CodeFlow](https://microsoft.github.io/open-pr/?codeflow=https://github.com/Azure/bicep/pull/13906)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to start with latest node version on Windows (tested with 18.20.2) - CVE-2024-27980
2 participants