Khalid Ali
Khalid Ali

Reputation: 373

Nodejs and npm installation on Windows

I know this question maybe looks like a stupid question, but I am new in using nodejs.

After I had installed the nodejs, I wrote this command to check it

->node -v

the output was

v10.3.0

but when I wrote

->npm -v

the output was

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


I saw this answer but it does not work for me.
And I uninstalled nodejs then I reinstalled it again.
I restarted the PC also, nothing happened.

Any suggestions ?

Upvotes: 1

Views: 899

Answers (2)

Khalid Ali
Khalid Ali

Reputation: 373

It works now after using nvm, from this link

As @Sharathi RB said in comments
It is node version manager it has capable of handling node basic installation issues include npm.
And moreover, direct node.js installation is not that much suggested. Always go with nvm which will help you to switch multiple node version on the same machine.

Upvotes: 0

Prashant Gupta
Prashant Gupta

Reputation: 790

In environment properties, in path variable just add **C:\Program Files\nodejs** and reopen CMD. It will work.

Upvotes: 1

Related Questions