======================================================================当我尝试安装install socket.io时,遇到错误。请查看cmd镜像和日志文件。

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 npm@2.14.12
3 info using node@v4.2.6
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 socket.io@latest
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.非常感谢您的帮助!
发布于 2016-02-11 11:39:28
这是一个标准的DNS错误。如果ping registry.npmjs.org不工作,那么包括npm在内的任何工作都不会发生。
检查您的DNS设置。
发布于 2016-02-11 12:39:08
无法解析DNS,请尝试指向一些公共DNS,例如Google at 8.8.8.8。如果您使用的是Linux,则将以下代码添加到您的/etc/resolv.conf中
名称服务器8.8.8.8
如果您使用的是Mac,那么请转到System Preferences -> Network -> Choose your connection -> Advanced -> DNS将8.8.8.8添加到集合中。
下面是你如何在Windows上做到这一点:http://www.doxer.org/resolved-resolv-conf-windows-equivalent/
附注:好的,你正在使用Windows,刚刚检查了你的镜像;)
https://stackoverflow.com/questions/35220110
复制相似问题