错误的ERR!代码ECONNREFUSED

时间:2017-09-22 06:18:13

标签: javascript node.js

我正在尝试安装loopback cli,但无法完成它。我收到的错误是下面提到的堆栈跟踪。

C:\Users>npm install -g loopback-cli
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "D:\\nodejs\\node.exe" "D:\\nodejs\\node_modules\\npm\\bin\\npm-cl
i.js" "install" "-g" "loopback-cli"
npm ERR! node v6.11.3
npm ERR! npm  v3.10.10
npm ERR! code ECONNREFUSED
npm ERR! errno ECONNREFUSED
npm ERR! syscall connect

npm ERR! Error: connect ECONNREFUSED 127.0.0.1:3000
npm ERR!     at Object.exports._errnoException (util.js:1020:11)
npm ERR!     at exports._exceptionWithHostPort (util.js:1043:20)
npm ERR!     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1086:14)
npm ERR!  { Error: connect ECONNREFUSED 127.0.0.1:3000
npm ERR!     at Object.exports._errnoException (util.js:1020:11)
npm ERR!     at exports._exceptionWithHostPort (util.js:1043:20)
npm ERR!     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1086:14)
npm ERR!   code: 'ECONNREFUSED',
npm ERR!   errno: 'ECONNREFUSED',
npm ERR!   syscall: 'connect',
npm ERR!   address: '127.0.0.1',
npm ERR!   port: 3000 }
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\npm-debug.log

2 个答案:

答案 0 :(得分:0)

我想你可能会坐在代理人后面。您必须在公司代理

后面设置npm和节点

打开命令提示符或终端会话并运行以下命令以配置npm以使用Web代理。这些命令使用proxy.company.com作为地址,使用8080作为端口。

npm config set proxy http://proxy.company.com:8080
npm config set https-proxy http://proxy.company.com:8080

请参阅并按照步骤进行操作 -

https://jjasonclark.com/how-to-setup-node-behind-web-proxy/

答案 1 :(得分:-1)

我认为npm服务器现在已经被打破了。 我甚至无法打开他们的网站https://www.npmjs.com