Home > Net >  npm install throws ECONNRESET error but only for certain packages
npm install throws ECONNRESET error but only for certain packages

Time:11-08

I'm working behind a corporate proxy. I have npm configured like this:

$ npm config get

...
https_proxy = "http://proxy.my-domain.com:8080" 
https-proxy = "http://proxy.my-domain.com:8080" 
proxy = "http://proxy.my-domain.com:8080"
... 

With these settings, I can install some packages fine, but not others. For example $ npm i react works perfectly fine, whereas installing @babel/core throws an ECONNRESET error.

$ npm i @babel/core

npm ERR! code ECONNRESET
npm ERR! syscall read
npm ERR! errno -54
npm ERR! network read ECONNRESET
...

Strangely, I'm able to install the package with yarn (which is configured for the proxy the same way npm is), but it too tells me that I have network issues (even though it successfully installs the package

  • Related