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
Steve BerleySteve Berley 

suddenly getting errors from force:project:create

I've been using VS Code for a while now doing work in a number of orgs but today I've started getting errors when trying to create new projects.
 
17:08:30.275 sfdx force:project:create --projectname Eden-tncDev --outputdir /Users/Steve/Dev/sfdx --template standard
ERROR running force:project:create:  Command failed with ENOENT: npm root -g --prefix /Users/Steve/Dev/sfdx/.yo-repository --loglevel error
spawnSync npm ENOENT
17:08:30.696 sfdx force:project:create --projectname Eden-tncDev --outputdir /Users/Steve/Dev/sfdx --template standard
 ended with exit code 1

I've already tried reinstalling the Salesforce extensions suite with no luck.  Any thoughts?

Thanks,

Steve 
Best Answer chosen by Steve Berley
ANUTEJANUTEJ (Salesforce Developers) 
HI Stev,

Can you please ensure the path is appropriate in environment variables?Also, can you clarify if you are seeing this message from a long time or just today?

See below links for more information:
https://stackoverflow.com/questions/59679185/npm-is-not-recognized-as-an-internal-or-external-command-operable-program-or

https://developer.salesforce.com/forums/?id=9062I000000IEleQAG
 
Hope this helps you. Please mark this answer as best so that others facing the same issue will find this information useful.
 
Thank you

All Answers

ANUTEJANUTEJ (Salesforce Developers) 
HI Stev,

Can you please ensure the path is appropriate in environment variables?Also, can you clarify if you are seeing this message from a long time or just today?

See below links for more information:
https://stackoverflow.com/questions/59679185/npm-is-not-recognized-as-an-internal-or-external-command-operable-program-or

https://developer.salesforce.com/forums/?id=9062I000000IEleQAG
 
Hope this helps you. Please mark this answer as best so that others facing the same issue will find this information useful.
 
Thank you
This was selected as the best answer
Steve BerleySteve Berley
Hi Anutej,

I can run other SFDX commands without problem so the path appears fine.  I last created a project about 7-10 days ago without any troubles and first noticed the issue today.  

Based on your suggestions, I reinstalled the CLI and it's now working.  No idea why/how it became corrupted but it's working now.

Thanks!
ANUTEJANUTEJ (Salesforce Developers) 
Glad to know that I was able to help. :)