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: handle spaces in node/npm path #718

Merged
merged 2 commits into from
Nov 13, 2023
Merged

Conversation

cristiand391
Copy link
Member

@cristiand391 cristiand391 commented Nov 13, 2023

Fixes: forcedotcom/cli#2564

Follow-up from: #711

The fix in 711 worked on my windows box because:

  1. tested with latest sf installed from npm
  2. the path to my node bin has a space

plugin-plugins get the path to the npm-cli.js from the bundled one, which in my case it didn't contain a space in the path so only quoting the node bin path was enough.

20231113_143955.jpg

When using a windows installer, both the node binary and npm-cli.js file come from the same CLI dir so both need to be double-quoted when passed to shelljs.exec.

plugin-trust does the same: https://github.com/salesforcecli/plugin-trust/blob/01b8161e22a59991e924ec491fc5c99dc409a796/src/shared/npmCommand.ts#L64

@ W-14480077@

@mdonnalley mdonnalley merged commit 083976a into main Nov 13, 2023
14 checks passed
@mdonnalley mdonnalley deleted the cd/fix-npm-check-win-cmd branch November 13, 2023 18:40
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.

sf plugins install failed (does not exist in the registry)
2 participants