ECONNREFUSED错误无法安装npm

时间:2015-04-23 13:16:54

标签: node.js npm nvm

安装npm时出错。这是节点及其依赖项

$ npm -v
2.7.4
$ node -v
v0.12.2
$ nvm list
->      v0.12.2
stable -> 0.12 (-> v0.12.2) (default)

这是完整的错误跟踪

$ npm install
npm WARN package.json malarvizhi@1.0.0 No description
npm WARN package.json malarvizhi@1.0.0 No repository field.
npm WARN package.json malarvizhi@1.0.0 No README data
npm WARN package.json Dependency 'grunt' exists in both dependencies and devDependencies, using 'grunt@^0.4.5' from dependencies
npm ERR! Linux 3.13.0-48-generic
npm ERR! argv "/home/malarvizhi/.nvm/versions/node/v0.12.2/bin/node" "/home/malarvizhi/.nvm/versions/node/v0.12.2/bin/npm" "install"
npm ERR! node v0.12.2
npm ERR! npm  v2.7.4
npm ERR! code ECONNREFUSED
npm ERR! errno ECONNREFUSED
npm ERR! syscall connect

npm ERR! Error: connect ECONNREFUSED
npm ERR!     at exports._errnoException (util.js:746:11)
npm ERR!     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1000:19)
npm ERR!  { [Error: connect ECONNREFUSED]
npm ERR!   code: 'ECONNREFUSED',
npm ERR!   errno: 'ECONNREFUSED',
npm ERR!   syscall: 'connect',
npm ERR!   parent: 'malarvizhi' }
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!     /home/malarvizhi/npm-debug.log

我尝试使用卸载并重新安装。但它仍然可以发生。有什么答案吗?

1 个答案:

答案 0 :(得分:-1)

尝试:npm install --no-bin-links