npm -v command giving exception

Viewed 23

While executing the npm -v command giving the below message:

'CALL "C:\Program Files (x86)\nodejs\\node.exe" "C:\Program Files (x86)\nodejs\\node_modules\npm\bin\npm-cli.js" prefix -g' is not recognized as an internal or external command,
operable program or batch file.
1 Answers

By default node installs into C:\Program Files (x86)\nodejs and adds itself to the PATH variable. If you have done a default installation of node.js (i.e. Node.js Windows Installer (.msi)), it can be started from the command prompt by typing node.

cd "C:\Program Files (x86)\nodejs"
npm install connect  

If you have installed node.js to a different directory, instead of "C:\Program Files (x86)\nodejs" substitute the path to nodejs in the first command.

Related