无法安装Grunt

时间:2016-01-06 00:38:47

标签: node.js gruntjs

这里需要一些帮助来传递咕噜声的安装

C:\Users\danie>npm install -g grunt-cli 
npm ERR! Windows_NT
  10.0.10586
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "grunt-cli"
npm ERR! node v5.3.0
npm ERR! npm  v3.3.12
npm ERR! code ECONNREFUSED
npm ERR! errno ECONNREFUSED
npm ERR! syscall connect
npm ERR! Error: connect ECONNREFUSED 127.0.0.1:8080
npm ERR!     at Object.exports._errnoException (util.js:855:11)
npm ERR!     at exports._exceptionWithHostPort (util.js:878:20)
npm ERR!     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1063:14)
npm ERR!  { [Error: connect ECONNREFUSED 127.0.0.1:8080]
npm ERR!   code: 'ECONNREFUSED',
npm ERR!   errno: 'ECONNREFUSED',
npm ERR!   syscall: 'connect',
npm ERR!   address: '127.0.0.1',
npm ERR!   port: 8080 }
npm ERR!
npm ERR! If you are behind a proxy, please make sure that the
npm ERR! 'proxy' config is set properly.  See: 'npm help config'
npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\danie\npm-debug.log

----接下来是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   '-g',
1 verbose cli   'grunt-cli' ]
2 info using npm@3.3.12
3 info using node@v5.3.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://localhost:8080/
12 silly mapToRegistry uri http://localhost:8080/grunt-cli
13 verbose request uri http://localhost:8080/grunt-cli
14 verbose request no auth needed
15 info attempt registry request try #1 at 1:08:34 AM
16 verbose request id 2b32ed7ffa936c5b
17 http request GET http://localhost:8080/grunt-cli
18 info retry will retry, error on last attempt: Error: connect ECONNREFUSED 127.0.0.1:8080
19 info attempt registry request try #2 at 1:08:46 AM
20 http request GET http://localhost:8080/grunt-cli
21 info retry will retry, error on last attempt: Error: connect ECONNREFUSED 127.0.0.1:8080
22 info attempt registry request try #3 at 1:09:47 AM
23 http request GET http://localhost:8080/grunt-cli
24 silly fetchPackageMetaData Error: connect ECONNREFUSED 127.0.0.1:8080
24 silly fetchPackageMetaData     at Object.exports._errnoException (util.js:855:11)
24 silly fetchPackageMetaData     at exports._exceptionWithHostPort (util.js:878:20)
24 silly fetchPackageMetaData     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1063:14)
24 silly fetchPackageMetaData  error for grunt-cli { [Error: connect ECONNREFUSED 127.0.0.1:8080]
24 silly fetchPackageMetaData   code: 'ECONNREFUSED',
24 silly fetchPackageMetaData   errno: 'ECONNREFUSED',
24 silly fetchPackageMetaData   syscall: 'connect',
24 silly fetchPackageMetaData   address: '127.0.0.1',
24 silly fetchPackageMetaData   port: 8080 }
25 silly rollbackFailedOptional Starting
26 silly rollbackFailedOptional Finishing
27 silly runTopLevelLifecycles Starting
28 silly runTopLevelLifecycles Finishing
29 silly install printInstalled
30 verbose stack Error: connect ECONNREFUSED 127.0.0.1:8080
30 verbose stack     at Object.exports._errnoException (util.js:855:11)
30 verbose stack     at exports._exceptionWithHostPort (util.js:878:20)
30 verbose stack     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1063:14)
31 verbose cwd C:\Users\danie
32 error Windows_NT 10.0.10586
33 error argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "grunt-cli"
34 error node v5.3.0
35 error npm  v3.3.12
36 error code ECONNREFUSED
37 error errno ECONNREFUSED
38 error syscall connect
39 error Error: connect ECONNREFUSED 127.0.0.1:8080
39 error     at Object.exports._errnoException (util.js:855:11)
39 error     at exports._exceptionWithHostPort (util.js:878:20)
39 error     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1063:14)
39 error  { [Error: connect ECONNREFUSED 127.0.0.1:8080]
39 error   code: 'ECONNREFUSED',
39 error   errno: 'ECONNREFUSED',
39 error   syscall: 'connect',
39 error   address: '127.0.0.1',
39 error   port: 8080 }
40 error If you are behind a proxy, please make sure that the
40 error 'proxy' config is set properly.  See: 'npm help config'
41 verbose exit [ 1, true ]

1 个答案:

答案 0 :(得分:1)

看起来像连接问题。你是代理人还是什么?

编辑:或者指向本地主机npm repo或代理? (在端口8080上)

好的,在不了解你的系统的情况下,很难给出一个非探索性的答案,但我会尽力将其充实为更多的推荐。

看起来你的npm客户端试图命中localhost:8080来拉取模块而不是正确的互联网端点。如果您尚未配置本地NPM存储库或类似的任何内容,请运行npm config list以查看是否在其中设置了导致事物命中该端点的任何内容(例如配置值)。你还应该检查你的npmrc文件,你的package.json和你的环境变量,看看那里是否有影响事物的设置;看起来npm期待代理。

https://docs.npmjs.com/cli/config