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

Impossible to install Salesforce CLI with the fix of CVE-2024-27980 on NodeJS #2822

Closed
gdecaen-klint opened this issue Apr 12, 2024 · 7 comments
Labels
bug Issue or pull request that identifies or fixes a bug more information required Issue requires more information or a response from the customer

Comments

@gdecaen-klint
Copy link

Summary

After installing the latest LTS version of NodeJS 20.12.2, I'm unable to install Salesforce CLI with npm

Steps To Reproduce

  • Install the latest LTS version of NodeJS (20.12.2)
  • run the following command in powershell : npm install @salesforce/cli -g

Expected result

Salesforce CLI installed correctly.

Actual result

Impossible to install Salesforce CLI
I have the following error:

1287 error command failed
1288 error command C:\WINDOWS\system32\cmd.exe /d /s /c node ./scripts/post-install-release-notes.js
1289 error node:internal/child_process:421
1289 error throw new ErrnoException(err, 'spawn');
1289 error ^
1289 error
1289 error Error: spawn EINVAL
1289 error at ChildProcess.spawn (node:internal/child_process:421:11)
1289 error at spawn (node:child_process:761:9)
1289 error at file:///C:/Users/Guillaume/AppData/Roaming/npm/node_modules/@salesforce/cli/scripts/post-install-release-notes.js:24:17
1289 error at new Promise ()
1289 error at main (file:////npm/node_modules/@salesforce/cli/scripts/post-install-release-notes.js:14:9)
1289 error at file:///C:/Users/Guillaume/AppData/Roaming/npm/node_modules/@salesforce/cli/scripts/post-install-release-notes.js:44:7 {
1289 error errno: -4071,
1289 error code: 'EINVAL',
1289 error syscall: 'spawn'
1289 error }
1289 error
1289 error Node.js v20.12.2

System Information

Windows 11

@gdecaen-klint gdecaen-klint added the investigating We're actively investigating this issue label Apr 12, 2024
Copy link

Hello @gdecaen-klint 👋 It looks like you didn't include the full Salesforce CLI version information in your issue.
Please provide the output of version --verbose --json for the CLI you're using (sf or sfdx).

A few more things to check:

  • Make sure you've provided detailed steps to reproduce your issue.
    • A repository that clearly demonstrates the bug is ideal.
  • Make sure you've installed the latest version of Salesforce CLI. (docs)
    • Better yet, try the rc or nightly versions. (docs)
  • Try running the doctor command to diagnose common issues.
  • Search GitHub for existing related issues.

Thank you!

@github-actions github-actions bot added more information required Issue requires more information or a response from the customer and removed investigating We're actively investigating this issue labels Apr 12, 2024
@gdecaen-klint
Copy link
Author

I can't provide version output as I am unable to install Salesforce CLI

@WillieRuemmele
Copy link
Member

WillieRuemmele commented Apr 12, 2024

I was able to install with node 20.12.2, but on mac. I will try windows soon.

we're using spawn to kick off a process in that post-install script. But it in that node version, that was disallowed. We're looking at how to reenable this functionality. Using the installers, or a different node version should work as an alternative while we address this

setting SF_HIDE_RELEASE_NOTES=true should allow that script to exit before attempting to spawn and work

@iowillhoit iowillhoit added the bug Issue or pull request that identifies or fixes a bug label Apr 12, 2024
Copy link

git2gus bot commented Apr 12, 2024

This issue has been linked to a new work item: W-15492081

@iowillhoit
Copy link
Contributor

iowillhoit commented Apr 17, 2024

The fix for this (and other spawn uses) was shipped in nightly last night and will be promoted to latest-rc later today.

It will be promoted to latest on April 24th.

@ravitejabandaru
Copy link

Hi @mshanemc , I am still getting the same error when I try to install Salesforce CLI using nodejs18 or nodejs20.

@mshanemc
Copy link
Contributor

Hi @mshanemc , I am still getting the same error when I try to install Salesforce CLI using nodejs18 or nodejs20.

please open a new issue so you can supply all the version info, along with how you're trying to install.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue or pull request that identifies or fixes a bug more information required Issue requires more information or a response from the customer
Projects
None yet
Development

No branches or pull requests

5 participants