安装任何NPM模块时出现NPM错误

时间:2014-03-18 08:33:22

标签: node.js socket.io npm wampserver

大家好我正在尝试安装npm模块http://socket.io/ ..实际上我在安装任何NPM 模块时遇到了同样的错误。

C:\wamp\www\nodetutorial>npm install socket.io
npm http GET https://registry.npmjs.org/socket.io
npm http GET https://registry.npmjs.org/socket.io
npm http GET https://registry.npmjs.org/socket.io
npm ERR! Error: connect ECONNREFUSED
npm ERR!     at errnoException (net.js:901:11)
npm ERR!     at Object.afterConnect [as oncomplete] (net.js:892: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 ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\\wamp\\www\\nodetutorial\\\\node.exe" "C:\\wamp\\www\\nodet
utorial\\node_modules\\npm\\bin\\npm-cli.js" "install" "socket.io"
npm ERR! cwd C:\wamp\www\nodetutorial
npm ERR! node -v v0.10.23
npm ERR! npm -v 1.3.17
npm ERR! syscall connect
npm ERR! code ECONNREFUSED
npm ERR! errno ECONNREFUSED
npm ERR! stack Error: connect ECONNREFUSED
npm ERR! stack     at errnoException (net.js:901:11)
npm ERR! stack     at Object.afterConnect [as oncomplete] (net.js:892:19)
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     C:\wamp\www\nodetutorial\npm-debug.log
npm ERR! not ok code 0

提前致谢..

1 个答案:

答案 0 :(得分:0)

我的网络连接中存在防火墙问题。 由于安全策略命令C:\wamp\www\nodetutorial>npm install socket.io 在尝试

时没有得到任何回应
npm http GET https://registry.npmjs.org/socket.io

当我在没有任何防火墙的情况下在家中尝试相同的命令时,它工作得很好......我没有错误