node.js - npm not working - "read ECONNRESET"

ID : 20221

viewed : 3

Tags : node.jsnpmnode.js

Top 5 Answer for node.js - npm not working - "read ECONNRESET"

vote vote



npm config set registry 

so that npm requests for http url instead of https.

and then try the same npm install command

vote vote


You may want to check your NPM proxy settings and perhaps remove it.

npm config get proxy npm config rm proxy npm config rm https-proxy 

One might expect a fresh install of NodeJS+NPM would not have a proxy configured. Strangely enough, mine did come with a proxy defined, pointing to an IP and port 3128. Removing the proxy did the trick.

vote vote


You may also need to specify the proxy server/port, in some environments the system settings for proxy are not enough for npm to work.

    npm config set proxy "" 
vote vote


Remove your proxy settings at home and switch on at Office networks, This may be irritating, But It worked for me:

npm config set proxy    npm config set https-proxy 


npm config rm proxy    npm config rm https-proxy 
vote vote


This can be caused by installing anything with npm using sudo -- this causes the files in the cache to be owned by root, resulting in this problem. You can fix it by running:

sudo rm -rf ~/.npm

to remove the cache. Then try whatever you were doing again, making sure you never use sudo along with npm (or the problem may come back).

Lots more information: npm throws error without sudo

Top 3 video Explaining node.js - npm not working - "read ECONNRESET"