如何使用npm install解决隧道套接字错误?

时间:2015-07-09 05:25:51

标签: angularjs node.js windows npm

我正在尝试在我的角度项目中运行npm install但导致错误:

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.

我尝试像这样设置npm代理:

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

我缺少什么或如何运行npm install?

1 个答案:

答案 0 :(得分:4)

设置" https时,不应使用' https' ,而应使用' http' 作为协议npm中的-proxy" 。只是做,

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