2016-02-05 93 views
0

======================================= =============================== 当我尝试安装安装socket.io时,遇到错误。请参阅cmd映像和日志文件。Node.js安装socket.io错误

enter image description here

0 info it worked if it ends with ok 
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe', 
1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js', 
1 verbose cli 'install', 
1 verbose cli 'socket.io' ] 
2 info using [email protected] 
3 info using [email protected] 
4 verbose install initial load of C:\inetpub\wwwroot\Test_NodeJSSocketIO\package.json 
5 verbose readDependencies loading dependencies from C:\inetpub\wwwroot\Test_NodeJSSocketIO\package.json 
6 silly cache add args [ 'socket.io', null ] 
7 verbose cache add spec socket.io 
8 silly cache add parsed spec Result { 
8 silly cache add raw: 'socket.io', 
8 silly cache add scope: null, 
8 silly cache add name: 'socket.io', 
8 silly cache add rawSpec: '', 
8 silly cache add spec: 'latest', 
8 silly cache add type: 'tag' } 
9 silly addNamed [email protected] 
10 verbose addNamed "latest" is being treated as a dist-tag for socket.io 
11 info addNameTag [ 'socket.io', 'latest' ] 
12 silly mapToRegistry name socket.io 
13 silly mapToRegistry using default registry 
14 silly mapToRegistry registry https://registry.npmjs.org/ 
15 silly mapToRegistry uri https://registry.npmjs.org/socket.io 
16 verbose addNameTag registry:https://registry.npmjs.org/socket.io not in flight; fetching 
17 verbose request uri https://registry.npmjs.org/socket.io 
18 verbose request no auth needed 
19 info attempt registry request try #1 at 16:55:55 
20 verbose request id 4772f4039b89ce43 
21 http request GET https://registry.npmjs.org/socket.io 
22 info retry will retry, error on last attempt: Error: getaddrinfo ENOTFOUND registry.npmjs.org registry.npmjs.org:443 
23 info attempt registry request try #2 at 16:56:05 
24 http request GET https://registry.npmjs.org/socket.io 
25 info retry will retry, error on last attempt: Error: getaddrinfo ENOTFOUND registry.npmjs.org registry.npmjs.org:443 
26 info attempt registry request try #3 at 16:57:05 
27 http request GET https://registry.npmjs.org/socket.io 
28 verbose stack Error: getaddrinfo ENOTFOUND registry.npmjs.org registry.npmjs.org:443 
28 verbose stack  at errnoException (dns.js:26:10) 
28 verbose stack  at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:77:26) 
29 verbose cwd C:\inetpub\wwwroot\Test_NodeJSSocketIO 
30 error Windows_NT 6.1.7601 
31 error argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "socket.io" 
32 error node v4.2.6 
33 error npm v2.14.12 
34 error code ENOTFOUND 
35 error errno ENOTFOUND 
36 error syscall getaddrinfo 
37 error network getaddrinfo ENOTFOUND registry.npmjs.org registry.npmjs.org:443 
37 error network This is most likely not a problem with npm itself 
37 error network and is related to network connectivity. 
37 error network In most cases you are behind a proxy or have bad network settings. 
37 error network 
37 error network If you are behind a proxy, please make sure that the 
37 error network 'proxy' config is set properly. See: 'npm help config' 
38 verbose exit [ 1, true ] 

我已经厌倦了以下几种方式,但没有运气。

1. Run as administrator 
2. npm config set registry http://registry.npmjs.org/ 
3. npm config set http_proxy=http://address:8080 
4. npm config get proxy -> null 
5. computer restarted. 

非常感谢您的帮助!

+4

[NPM ERR的可能的复制!网络getaddrinfo ENOTFOUND](http://stackoverflow.com/questions/23193614/npm-err-network-getaddrinfo-enotfound) –

+0

http://stackoverflow.com/questions/17690803/node-js-getaddrinfo-enotfound –

+0

请检查@shock_gone_wild链接它可能会帮助你 –

回答

0

这是一个标准的DNS错误。如果ping registry.npmjs.org不起作用,那么没有工作,包括npm。

检查您的DNS设置。

+0

错误信息:“Ping请求无法找到主机registry.npmjs.org,请检查名称并重试。”有任何DNS设置文档让我试试?非常感谢! – Yves

0

DNS无法解析,请尝试指向某些公共DNS,例如Google在8.8.8.8。如果你是在Linux上,然后添加到您的/etc/resolv.conf

域名服务器8.8.8.8

如果你是在Mac OS X,然后去System Preferences -> Network -> Choose your connection -> Advanced -> DNS添加8.8.8.8到集合中。

这里是你如何做到这一点的Windowshttp://www.doxer.org/resolved-resolv-conf-windows-equivalent/

P.S好您使用的是Windows只是检查你的形象;)