+ Start a Discussion
AD1418AD1418 

'npm' is not recognized as an internal or external command, operable program or batch file in vs code error

Hi Folks,

I was using vscode and all of sudden I wasnt able to create components and faced npm issue :-

'npm' is not recognized as an internal or external command,
operable program or batch file.

User-added imageUser-added image
Need some assistance on resolving this. Can someone plz help here.

Thanks
SwethaSwetha (Salesforce Developers) 
HI,

It appears to be an issue with the path. Can you add your VS path in below and see if it fixes the issue.

MyComputer->properties->advance system setting-> Environment variables-> select & edit "Path" variable in System variables.
 
Hope this helps you. Please mark this answer as best so that others facing the same issue will find this information useful.
 
Thank you
AD1418AD1418
Hi Swetha, T

Thanks for your response. Added the path, still it didnt worked for me. Any other workarounds?

Thanks
SwethaSwetha (Salesforce Developers) 
HI AD1418,
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
Dharmendra SalesforceDharmendra Salesforce
Hi AD1418, 
Just install Node JS in your system and it will work. 
I was also facing the same problem and installation of Node JS has fixed the issue.

Issue could be due to the latest release of Salesforce CLI which seems to require external node JS installation. 
Thanks.
AD1418AD1418
Thanks Dharmendra. It worked.
Ahmed Djallel BOUISRIAhmed Djallel BOUISRI
This issue appeared after the last Salesforce CLI update, which now requires npm package manager to work.
Just make sure that npm is installed and the path to it is configured in global system variables. (head to this link to install it if not already done Node.js and npm (https://www.npmjs.com/get-npm))

Please mark as resolved,
Thank you.