NPM doesn't install any modules: network socket hangs up

i had same problem. it seems that there is some problem with ISP's https handling. doing:

npm config set registry http://registry.npmjs.org/

worked for me


I was having the same problem. Found a solution in this thread. You can see the effective proxy that npm is using by doing:

npm config get proxy
npm config get https-proxy

If you're behinid a proxy, try this:

mv ~/.npmrc ~/.npmrc.bak

I was having a similar issue with my windows machine and i fixed it by first checking whether my proxy got some value by executing the below command.

npm config get proxy

in return i got the below:

http://usr:pwd@host/:port

So if anyone who is not under a proxy layer first set the proxy as null by executing the below command.

npm config set proxy null

now if you excecute your npm i it should not throw any network error.