function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
James George 00700James George 00700 

SFDX new Project creation failure (npm error)

Hi Friends,
Did anybody faced this issue, I am trying to create a project in VS Code, got the below error.
Please let me know your valuable comments.
Starting SFDX: Create Project

18:49:54.38 sfdx force:project:create --projectname MyProject --outputdir c:\SFDX\DevCert2 --template empty
ERROR running force:project:create:  Command failed with exit code 1: npm root -g --prefix c:\SFDX\DevCert2\.yo-repository --loglevel error
'npm' is not recognized as an internal or external command,
operable program or batch file.
18:49:54.942 sfdx force:project:create --projectname MyProject --outputdir c:\SFDX\DevCert2 --template empty
 ended with exit code 1

 
Best Answer chosen by James George 00700
ANUTEJANUTEJ (Salesforce Developers) 
Hi James,

As per https://salesforce.stackexchange.com/questions/304554/npm-is-not-recognized-as-an-internal-or-external-command-vs-code-salesforc this appears to be an issue many users reported after having Salesforce CLI updated to the latest version "sfdx-cli/7.56.1-2773b53bf5"

So the solution would be to either install the NPM package manager or install nodejs.

Hope this helps you. Please mark this answer as best so that others facing the same issue will find this information useful.
 
Thank you
 Anutej

All Answers

ANUTEJANUTEJ (Salesforce Developers) 
Hi James,

As per https://salesforce.stackexchange.com/questions/304554/npm-is-not-recognized-as-an-internal-or-external-command-vs-code-salesforc this appears to be an issue many users reported after having Salesforce CLI updated to the latest version "sfdx-cli/7.56.1-2773b53bf5"

So the solution would be to either install the NPM package manager or install nodejs.

Hope this helps you. Please mark this answer as best so that others facing the same issue will find this information useful.
 
Thank you
 Anutej
This was selected as the best answer
James George 00700James George 00700
Hi Anutej,
I re-installed the node.js, the issue is no longer appearing.

Thanks
James George