Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Node.JS NPM not working on Windows

I just installed the latest version of nodejs, and while I can get it to run js files just fine, I can't get npm to do anything.

If I open the node.exe, it brings up a prompt, then I separately tried each of the following and none of them work:

> node npm install socket.io
> npm install socket.io
> help
> node help

ALL of the above result in nothing but the line "..." to be returned, then every thing I type in after that, I just get another line of "...".

This is extremely frustrating. What am I doing wrong?

like image 301
Ben Lesh Avatar asked Feb 19 '26 00:02

Ben Lesh


2 Answers

If you had command prompt open whilst installing the latest nodejs then the path to npm in windows path will not be recognised until you close the command prompt and open a new one.

I know this already has an accepted answer but I just found this and then realised my own mistake and thought it might help someone else.

like image 156
Robert Went Avatar answered Feb 21 '26 13:02

Robert Went


Opening node.exe will bring up the Read–eval–print loop (REPL). Try just:

c:\users\windowslogin>npm install socket.io
like image 38
deltanovember Avatar answered Feb 21 '26 15:02

deltanovember



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!