npm Community Forum (Archive)

The npm community forum has been discontinued.

To discuss usage of npm, visit the GitHub Support Community.

npm -v returns error message "perfix -g is not recognized as an internal or external command"

Hi,

I’ve installed Node and NPM by installing the MSI installer on https://nodejs.org/en/download/. No issues here but when I run “npm -v” in CMD I get the error message ‘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. Node version is 10.15.0, NPM version is 6.4.1.

I’ve added a screenshot of my environment variables (system variables), perhaps this can help.
My user variable for NPM is C:\Users\bcorn\AppData\Roaming\npm.

Kind regards,

Benoit


Does nodejs itself own work?


Yes, when I’m running “node-v” in CMD everything works fine, no error messages are fired.


This seems related: