Trying to create a Salesforce project in VSCode. I have been using it since the last 1 year and everything was working fine until now. I reinstalled the Salesforce Extension Pack as well.
Project should get created
Got an error:
Starting SFDX: Create Project
19:16:35.466 sfdx force:project:create --projectname psb_06may --outputdir /Users/saakshigupta/Documents --template standard --manifest
ERROR running force:project:create: Command failed with ENOENT: npm root -g --prefix /Users/saakshigupta/Documents/.yo-repository --loglevel error
spawnSync npm ENOENT
19:16:36.33 sfdx force:project:create --projectname psb_06may --outputdir /Users/saakshigupta/Documents --template standard --manifest
ended with exit code 1
_Feel free to attach a screenshot_.
VS Code Version: 1.41.1
SFDX CLI Version: 48.13.0
OS and version: Mac OS Catalina Version 10.15.4 (19E287)
I get exactly the same error today except by following Trailhead instructions
sfdx --version
sfdx-cli/7.56.1-2773b53bf5 darwin-x64 node-v10.15.3
sfdx plugins --core
@oclif/plugin-autocomplete 0.1.5 (core)
@oclif/plugin-commands 1.2.3 (core)
@oclif/plugin-help 2.2.3 (core)
@oclif/plugin-not-found 1.2.3 (core)
@oclif/plugin-plugins 1.7.9 (core)
@oclif/plugin-update 1.3.9 (core)
@oclif/plugin-warn-if-update-available 1.7.0 (core)
@oclif/plugin-which 1.0.3 (core)
@salesforce/sfdx-trust 3.0.7 (core)
analytics 1.7.1 (core)
generator 1.1.2 (core)
salesforcedx 48.12.1
鈹溾攢 @salesforce/sfdx-plugin-lwc-test 0.1.5
鈹溾攢 salesforcedx-templates 48.10.0
鈹斺攢 salesforce-alm 48.12.0
I'm having the same problem.
Version info:
sfdx-cli/7.56.1-2773b53bf5 linux-x64 node-v10.15.3
@oclif/plugin-autocomplete 0.1.5 (core)
@oclif/plugin-commands 1.2.3 (core)
@oclif/plugin-help 2.2.3 (core)
@oclif/plugin-not-found 1.2.3 (core)
@oclif/plugin-plugins 1.7.9 (core)
@oclif/plugin-update 1.3.9 (core)
@oclif/plugin-warn-if-update-available 1.7.0 (core)
@oclif/plugin-which 1.0.3 (core)
@salesforce/sfdx-trust 3.0.7 (core)
analytics 1.7.1 (core)
generator 1.1.2 (core)
salesforcedx 48.12.1 (core)
鈹溾攢 @salesforce/sfdx-plugin-lwc-test 0.1.5 (core)
鈹溾攢 salesforcedx-templates 48.10.0 (core)
鈹斺攢 salesforce-alm 48.12.0 (core)
sfdx-cli 7.56.1 (core)
Hi, I figure this out. The reason it was failing is because the 'npm' package installer didn't exist. npm comes with node.js, so I installed node.js w/ npm and I was then able to create my project.
Downloading and installing from https://nodejs.org/en/download/ cleared this up. The VSCode w/ Salesforce extension instructions / prerequisites should be updated
@carfi187 @cropredy Thank you so much for your help. It worked :)
So Github doesn't notify about a comment on the question? Had I not checked today, I would have never realised that you guys have commented.
Anyway, thanks again!
Thanks for reporting this, we released a fix for it in the latest version of the Salesforce CLI 7.58.2, no need to install nodejs & npm
Most helpful comment
Hi, I figure this out. The reason it was failing is because the 'npm' package installer didn't exist. npm comes with node.js, so I installed node.js w/ npm and I was then able to create my project.