简体   繁体   中英

npm ERR! code ECONNREFUSED

I am trying to install loopback cli, but unable to get it done. I am getting an error of which the stacktrace is mentioned below.

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

I think you might be sitting behind a proxy. You will have to set-up npm and node behind the corporate proxy

Open an command prompt or terminal session and run the following commands to configure npm to work with your web proxy. The commands use proxy.company.com as the address and 8080 as the port.

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

Please refer and follow the steps -

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

I think npm server is currenty broken right now. I cannot even open their website https://www.npmjs.com

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM