npm安装错误连接ECONNREFUSED 127.0.0.1:8080

时间:2016-12-12 00:10:53

标签: node.js express npm-install

我刚刚开始研究我的第一个节点JS应用程序,在尝试通过npm安装express时,我遇到了以下错误:

 Error: connect ECONNREFUSED 127.0.0.1:8080
     at Object.exports._errnoException (util.js:870:11)
     at exports._exceptionWithHostPort (util.js:893:20)
     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1057:14)
  { [Error: connect ECONNREFUSED 127.0.0.1:8080]
   code: 'ECONNREFUSED',
   errno: 'ECONNREFUSED',
   syscall: 'connect',
   address: '127.0.0.1',
   port: 8080 }

并在npm-debug:

36 verbose stack Error: connect ECONNREFUSED 127.0.0.1:8080
36 verbose stack     at Object.exports._errnoException (util.js:870:11)
36 verbose stack     at exports._exceptionWithHostPort (util.js:893:20)
36 verbose stack     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1057:14)
37 verbose cwd C:\APS\NodeJS
38 error Windows_NT 6.1.7601
39 error argv "C:\\APS\\NodeJS\\node.exe" "C:\\APS\\NodeJS\\node_modules\\npm\\bin\\npm-cli.js" "install" "express"
40 error node v4.4.0
41 error npm  v2.14.20
42 error code ECONNREFUSED
43 error errno ECONNREFUSED
44 error syscall connect
45 error Error: connect ECONNREFUSED 127.0.0.1:8080
45 error     at Object.exports._errnoException (util.js:870:11)
45 error     at exports._exceptionWithHostPort (util.js:893:20)
45 error     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1057:14)
45 error  { [Error: connect ECONNREFUSED 127.0.0.1:8080]
45 error   code: 'ECONNREFUSED',
45 error   errno: 'ECONNREFUSED',
45 error   syscall: 'connect',
45 error   address: '127.0.0.1',
45 error   port: 8080 }
46 error If you are behind a proxy, please make sure that the
46 error 'proxy' config is set properly.  See: 'npm help config'
47 verbose exit [ 1, true ]
如果遇到这样的问题的任何人都可以帮助他们做出批评,那么我就会讨论问题而无法找到某些东西。 TNX

1 个答案:

答案 0 :(得分:6)

问题已解决

错误是由于我的一次尝试可能是错误的代理配置。帮助我的是: npm install not work

我做了以下事情:

  1. npm config set proxy null npm config set https-proxy null
  2. npm config set registry http://registry.npmjs.org/
  3. 感谢所有想要帮助的人

相关问题