2013-12-23 163 views
2

我试过npm install -g phonegap并且几秒钟后我会发现这个错误和警告 enter image description here错误代码0:npm install -g phonegap

,并几分钟后再次Socket hang up enter image description here

而在最后,没有安装 enter image description here

我应该提及我想这

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

甚至

npm config set registry https://github.com/ariya/esprima/tarball/master 

,但他们没有工作。

回答

1

如果您可以从您的浏览器下载https://github.com/ariya/esprima/tarball/master,这意味着您的网络正常。

我认为这个问题是因为github服务器延迟了响应以防止DDos攻击。

您可以更改以下默认值:

fetch-retries = 2 
fetch-retry-factor = 10 
fetch-retry-maxtimeout = 60000 
fetch-retry-mintimeout = 10000 

例如:

npm config set fetch-retries 4 
npm config set fetch-retry-maxtimeout 120000 
npm config set fetch-retry-mintimeout 60000 
相关问题