Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

npm

I'm getting:

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

when I issue:

npm install -g bower polyserve

Even though I have downloaded node.

like image 865
Phillip Senn Avatar asked Oct 10 '15 15:10

Phillip Senn


2 Answers

I think you have not defined the path of nodejs in Environment Variables on the System Properties.

Add ;C:\Program Files\nodejs\ (path of your nodejs installed directory)

To the end of your Path variable on the "User variable" section of the Environment Variables on the System Properties.

Then reopen cmd prompt and type npm again.It should work now.Hope it helps.

You can do one more thing if still it does not work.Reboot your machine after installing node.

like image 166
Vikas Sharma Avatar answered Oct 03 '22 14:10

Vikas Sharma


Set path for node.js in your environment variables. To do this:

  1. right click on MyComputer->properties->advance system setting-> Environment variables-> select & edit "Path" variable in System variables.
  2. Add C:\Program Files\nodejs\; in path
  3. Restart your command prompt
  4. Type node --version in a new console window, the version number should appear as a response.
like image 24
Nil Avatar answered Oct 03 '22 14:10

Nil