简体   繁体   中英

how to get around tunneling socket error with npm install?

I am trying to run npm install in my angular project but results in an error:

error network tunneling socket could not be established, cause=read ECONNRESET
error network This is most likely not a problem with npm itself
error network and is related to network connectivity.
error network In most cases you are behind a proxy or have bad network settings.

I tried to set the npm proxy like this:

npm config set proxy http://myproxy
npm config set https-proxy https://myproxy
npm config set registry "http://registry.npmjs.org/"

What am I missing or how can I run npm install?

You should not use 'https' but 'http' as protocol when setting "https-proxy" in npm. Just do,

>npm config set https-proxy http://myproxy

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM