无法使用npm命令安装任何东西

时间:2015-10-27 06:14:28

标签: npm

node version :- v4.2.1
npm version :- 2.14.7
npm config get proxy: - null
npm config get https-proxy :- null

无法在mac el capitan上安装bower,ionic,cordova,它只是说:

npm WARN Building the local index for the first time, please be patient
npm ERR! Darwin 15.0.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "search"
npm ERR! node v4.2.1
npm ERR! npm v2.14.7
npm ERR! code ENOTFOUND
npm ERR! errno ENOTFOUND
npm ERR! syscall getaddrinfo

npm ERR! network getaddrinfo ENOTFOUND registry.npmjs.org registry.npmjs.org:80
npm ERR! network This is most likely not a problem with npm itself
npm ERR! network and is related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network 
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly. See: 'npm help config'

npm ERR! Please include the following file with any support request:
npm ERR! /Users/shashank/npm-debug.log

debug.log :- 
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node',
1 verbose cli '/usr/local/bin/npm',
1 verbose cli 'install',
1 verbose cli 'bower' ]
2 info using npm@2.14.7
3 info using node@v4.2.1
4 verbose config Skipping project config: /Users/shashank/.npmrc. (matches userconfig)
5 verbose install initial load of /Users/shashank/package.json
6 verbose readDependencies loading dependencies from /Users/shashank/package.json
7 silly cache add args [ 'bower', null ]
8 verbose cache add spec bower
9 silly cache add parsed spec Result {
9 silly cache add raw: 'bower',
9 silly cache add scope: null,
9 silly cache add name: 'bower',
9 silly cache add rawSpec: '',
9 silly cache add spec: '',
9 silly cache add type: 'range' }
10 silly addNamed bower@
11 verbose addNamed "" is a valid semver range for bower
12 silly addNameRange { name: 'bower', range: '', hasData: false }
13 silly mapToRegistry name bower
14 silly mapToRegistry using default registry
15 silly mapToRegistry registry http: //registry.npmjs.org/
16 silly mapToRegistry uri http: //registry.npmjs.org/bower
17 verbose addNameRange registry:http:  //registry.npmjs.org/bower not in flight; fetching
18 verbose request uri http: //"registry.npmjs.org/bower"
19 verbose request no auth needed
20 info attempt registry request try #1 at 10:37:36 AM
21 verbose request id 0385537c58e562b4
22 http request GET http: //registry.npmjs.org/bower
23 info retry will retry, error on last attempt: Error: getaddrinfo ENOTFOUND registry.npmjs.org registry.npmjs.org:80
24 info attempt registry request try #2 at 10:37:49 AM
25 http request GET http: //registry.npmjs.org/bower
26 info retry will retry, error on last attempt: Error: getaddrinfo ENOTFOUND registry.npmjs.org registry.npmjs.org:80
27 info attempt registry request try #3 at 10:38:52 AM
28 http request GET http: //registry.npmjs.org/bower
29 verbose stack Error: getaddrinfo ENOTFOUND registry.npmjs.org registry.npmjs.org:80
29 verbose stack at errnoException (dns.js:26:10)
29 verbose stack at GetAddrInfoReqWrap.onlookup as oncomplete
30 verbose cwd /Users/shashank
31 error Darwin 15.0.0
32 error argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "bower"
33 error node v4.2.1
34 error npm v2.14.7
35 error code ENOTFOUND
36 error errno ENOTFOUND
37 error syscall getaddrinfo
38 error network getaddrinfo ENOTFOUND registry.npmjs.org registry.npmjs.org:80
38 error network This is most likely not a problem with npm itself
38 error network and is related to network connectivity.
38 error network In most cases you are behind a proxy or have bad network settings.
38 error network
38 error network If you are behind a proxy, please make sure that the
"~/npm-debug.log" [readonly] 57L, 2836C

1 个答案:

答案 0 :(得分:-1)

请在路由器中禁用防火墙。从路由器设置中禁用路由器防火墙后,我遇到了类似的问题。