prefix -g' is not recognized as an internal or external command, operable program or batch file

348 Views Asked by At

I have installed NODEJS succesfully. But when I check for the versions, node version is showing correctly.But when I check for npm version,I get the following error along with the version.

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

I am unable to understand what went wrong during the installation.

Please help!

Thanks in advance!

2

There are 2 best solutions below

0
galkin On

I guess you try to run npm -g -v and receive this error. This is normal behavior on Windows OS. You should have error on npm -g install yo or npm -g ls.

0
Akshay Deshmukh On

Check the system configuration in System- Follow this configuration this is work for me

System-Edit Enviroment variables-
ComSpec C:\WINDOWS\system32\cmd.exe