安装Yeoman时出现问题错误:连接ECONNREFUSED

时间:2014-11-25 17:17:30

标签: windows node.js npm nodes

npm ERR! `Error: connect ECONNREFUSED`
npm ERR!     `at errnoException (net.js:904:11)`
npm ERR!     `at Object.afterConnect [as oncomplete] (net.js:895:19)`
npm ERR!  `{ [Error: connect ECONNREFUSED]`
npm ERR!   `code: 'ECONNREFUSED',`
npm ERR!   `errno: 'ECONNREFUSED',`
npm ERR!   `syscall: 'connect' }`
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 install -g yo时,我都会收到上面列出的错误。我不确定接下来该做什么。

1 个答案:

答案 0 :(得分:0)

只需要设置

npm config set proxy http://usr:pwd@proxyname:port

npm config set https-proxy http://usr:pwd@proxyname:port