我正在尝试全局安装express-generator但仍然遇到此错误
我正在使用我的Android手机作为连接互联网的热点,我的网络也很好。
我没有使用代理连接到互联网
我最近安装了node.js,所以我相信一切都是最新的
我的npm-debug.log文件的内容:
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 'express-generator',
1 verbose cli '-g' ]
2 info using npm@3.10.10
3 info using node@v6.10.3
4 silly loadCurrentTree Starting
5 silly install loadCurrentTree
6 silly install readGlobalPackageData
7 silly fetchPackageMetaData express-generator
8 silly fetchNamedPackageData express-generator
9 silly mapToRegistry name express-generator
10 silly mapToRegistry using default registry
11 silly mapToRegistry registry http://registry.npmjs.org/
12 silly mapToRegistry data Result {
12 silly mapToRegistry raw: 'express-generator',
12 silly mapToRegistry scope: null,
12 silly mapToRegistry escapedName: 'express-generator',
12 silly mapToRegistry name: 'express-generator',
12 silly mapToRegistry rawSpec: '',
12 silly mapToRegistry spec: 'latest',
12 silly mapToRegistry type: 'tag' }
13 silly mapToRegistry uri http://registry.npmjs.org/express-generator
14 verbose request uri http://registry.npmjs.org/express-generator
15 verbose request no auth needed
16 info attempt registry request try #1 at 6:11:37 PM
17 verbose request id ba90169705422372
18 http request GET http://registry.npmjs.org/express-generator
19 info retry will retry, error on last attempt: Error: getaddrinfo ENOTFOUND proxy proxy:00
20 info attempt registry request try #2 at 6:11:49 PM
21 http request GET http://registry.npmjs.org/express-generator
22 info retry will retry, error on last attempt: Error: getaddrinfo ENOTFOUND proxy proxy:00
23 info attempt registry request try #3 at 6:12:52 PM
24 http request GET http://registry.npmjs.org/express-generator
25 silly fetchPackageMetaData Error: getaddrinfo ENOTFOUND proxy proxy:00
25 silly fetchPackageMetaData at errnoException (dns.js:28:10)
25 silly fetchPackageMetaData at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:76:26)
25 silly fetchPackageMetaData error for express-generator { Error: getaddrinfo ENOTFOUND proxy proxy:00
25 silly fetchPackageMetaData at errnoException (dns.js:28:10)
25 silly fetchPackageMetaData at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:76:26)
25 silly fetchPackageMetaData code: 'ENOTFOUND',
25 silly fetchPackageMetaData errno: 'ENOTFOUND',
25 silly fetchPackageMetaData syscall: 'getaddrinfo',
25 silly fetchPackageMetaData hostname: 'proxy',
25 silly fetchPackageMetaData host: 'proxy',
25 silly fetchPackageMetaData port: '00' }
26 silly rollbackFailedOptional Starting
27 silly rollbackFailedOptional Finishing
28 silly runTopLevelLifecycles Finishing
29 silly install printInstalled
30 verbose stack Error: getaddrinfo ENOTFOUND proxy proxy:00
30 verbose stack at errnoException (dns.js:28:10)
30 verbose stack at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:76:26)
31 verbose cwd C:\Users\user\Desktop\backup\Documents\Web Dev\ServerSide
32 error Windows_NT 6.1.7601
33 error argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "express-generator" "-g"
34 error node v6.10.3
35 error npm v3.10.10
36 error code ENOTFOUND
37 error errno ENOTFOUND
38 error syscall getaddrinfo
39 error network getaddrinfo ENOTFOUND proxy proxy:00
40 error network This is most likely not a problem with npm itself
40 error network and is related to network connectivity.
40 error network In most cases you are behind a proxy or have bad network settings.
40 error network
40 error network If you are behind a proxy, please make sure that the
40 error network 'proxy' config is set properly. See: 'npm help config'
41 verbose exit [ 1, true ]
答案 0 :(得分:0)
尝试删除代理配置并运行
npm config delete proxy