首页 新闻 搜索 专区 学院

npm安装任何软件包都报超时

1
[已解决问题] 解决于 2016-06-12 00:01

使用npm安装任何软件包都报网络错误,也尝试了设置镜像,但是均无用,请大牛帮忙,错误日志如下:

0 info it worked if it ends with ok
1 verbose cli [ 'd:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'd:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'install',
1 verbose cli   '-g',
1 verbose cli   'grunt-cli' ]
2 info using npm@3.8.9
3 info using node@v6.2.0
4 silly loadCurrentTree Starting
5 silly install loadCurrentTree
6 silly install readGlobalPackageData
7 silly fetchPackageMetaData grunt-cli
8 silly fetchNamedPackageData grunt-cli
9 silly mapToRegistry name grunt-cli
10 silly mapToRegistry using default registry
11 silly mapToRegistry registry http://registry.npmjs.org/
12 silly mapToRegistry data Result {
12 silly mapToRegistry   raw: 'grunt-cli',
12 silly mapToRegistry   scope: null,
12 silly mapToRegistry   name: 'grunt-cli',
12 silly mapToRegistry   rawSpec: '',
12 silly mapToRegistry   spec: 'latest',
12 silly mapToRegistry   type: 'tag' }
13 silly mapToRegistry uri http://registry.npmjs.org/grunt-cli
14 verbose request uri http://registry.npmjs.org/grunt-cli
15 verbose request no auth needed
16 info attempt registry request try #1 at 16:44:54
17 verbose request id 7be466a0b156989a
18 http request GET http://registry.npmjs.org/grunt-cli
19 info retry will retry, error on last attempt: Error: connect ETIMEDOUT 111.202.129.220:3128
20 info attempt registry request try #2 at 16:45:25
21 http request GET http://registry.npmjs.org/grunt-cli
22 info retry will retry, error on last attempt: Error: connect ETIMEDOUT 111.202.129.220:3128
23 info attempt registry request try #3 at 16:46:46
24 http request GET http://registry.npmjs.org/grunt-cli
25 silly fetchPackageMetaData Error: connect ETIMEDOUT 111.202.129.220:3128
25 silly fetchPackageMetaData     at Object.exports._errnoException (util.js:953:11)
25 silly fetchPackageMetaData     at exports._exceptionWithHostPort (util.js:976:20)
25 silly fetchPackageMetaData     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1080:14)
25 silly fetchPackageMetaData  error for grunt-cli { Error: connect ETIMEDOUT 111.202.129.220:3128
25 silly fetchPackageMetaData     at Object.exports._errnoException (util.js:953:11)
25 silly fetchPackageMetaData     at exports._exceptionWithHostPort (util.js:976:20)
25 silly fetchPackageMetaData     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1080:14)
25 silly fetchPackageMetaData   code: 'ETIMEDOUT',
25 silly fetchPackageMetaData   errno: 'ETIMEDOUT',
25 silly fetchPackageMetaData   syscall: 'connect',
25 silly fetchPackageMetaData   address: '111.202.129.220',
25 silly fetchPackageMetaData   port: 3128 }
26 silly rollbackFailedOptional Starting
27 silly rollbackFailedOptional Finishing
28 silly runTopLevelLifecycles Starting
29 silly runTopLevelLifecycles Finishing
30 silly install printInstalled
31 verbose stack Error: connect ETIMEDOUT 111.202.129.220:3128
31 verbose stack     at Object.exports._errnoException (util.js:953:11)
31 verbose stack     at exports._exceptionWithHostPort (util.js:976:20)
31 verbose stack     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1080:14)
32 verbose cwd c:\Users\ycy\Desktop
33 error Windows_NT 6.1.7601
34 error argv "d:\\Program Files\\nodejs\\node.exe" "d:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "grunt-cli"
35 error node v6.2.0
36 error npm  v3.8.9
37 error code ETIMEDOUT
38 error errno ETIMEDOUT
39 error syscall connect
40 error network connect ETIMEDOUT 111.202.129.220:3128
41 error network This is most likely not a problem with npm itself
41 error network and is related to network connectivity.
41 error network In most cases you are behind a proxy or have bad network settings.
41 error network
41 error network If you are behind a proxy, please make sure that the
41 error network 'proxy' config is set properly.  See: 'npm help config'
42 verbose exit [ 1, true ]
我为设置任何代理。。。

灵魂盗猎者的主页 灵魂盗猎者 | 菜鸟二级 | 园豆:226
提问于:2016-06-10 17:38
< >
分享
最佳答案
0

使用cnpm或者是设置为淘宝的镜像

奖励园豆:5
seayxu | 大侠五级 |园豆:5468 | 2016-06-10 17:49

设置淘宝镜像,仍然不行。。。

灵魂盗猎者 | 园豆:226 (菜鸟二级) | 2016-06-10 18:53

@灵魂盗猎者: 你看下设置成功没有。

seayxu | 园豆:5468 (大侠五级) | 2016-06-10 20:38

@SeayXu: 感谢回答,应该是我电脑系统的原因,我在另一台电脑上装就完全没有问题,也不用设置镜像之类的。感谢!!

灵魂盗猎者 | 园豆:226 (菜鸟二级) | 2016-06-12 00:02
其他回答(1)
0

哥们你的现在弄好了吗!我的情况跟你一模一样!不知道怎么搞?

 

蓝翎君主 | 园豆:202 (菜鸟二级) | 2017-02-22 13:38

重装系统就可以了,应该是系统里面有哪设置了代理了。

支持(0) 反对(0) 灵魂盗猎者 | 园豆:226 (菜鸟二级) | 2017-03-02 14:39

@灵魂盗猎者: 你重装系统好了?我先用的Linux虚拟机可以,后来为了布置分布式启用云主机就网络连接超时。

支持(0) 反对(0) 知识的游牧民族 | 园豆:200 (初学一级) | 2018-08-19 15:27
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册