我正在尝试安装node_module,但得到了以下错误:
例如:npm安装grunt-预处理
D:\grunt_pre>npm install grunt-preprocess
npm http GET https://registry.npmjs.org/grunt-preprocess
npm http GET https://registry.npmjs.org/grunt-preprocess
npm http GET https://registry.npmjs.org/grunt-preprocess
npm ERR! Error: connect ETIMEDOUT
npm ERR! at errnoException (net.js:901:11)
npm ERR! at Object.afterConnect [as oncomplete] (net.js:892:19)
npm ERR! If you need help, you may report this log at:
npm ERR! <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR! <npm-@googlegroups.com>
npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nod
ejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "grunt-preprocess"
npm ERR! cwd D:\grunt_pre
npm ERR! node -v v0.10.15
npm ERR! npm -v 1.3.5
npm ERR! syscall connect
npm ERR! code ETIMEDOUT
npm ERR! errno ETIMEDOUT
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! D:\grunt_pre\npm-debug.log
npm ERR! not ok code 0发布于 2016-11-04 17:19:29
我还犯了ETIMEDOUT错误,并且能够通过禁用路由器的防火墙、重新启动它来解决这个问题,最重要的是,使用以下npm命令配置同步连接的数量:
npm set maxsockets 3这将设置最大连接数3,而不是默认的50。CLI自npm@3.8.0以来一直允许这一选项。有关更多参考,请参见此链接。
发布于 2013-08-14 11:13:01
试试“Canmah”的答案。如果没有帮助,请尝试检查代理配置。
如果有代理,请按下面所述更新npm注册表,然后尝试安装节点模块。
@ the command prompt update the
npm config set proxy <proxyserver>:<port>发布于 2013-08-14 11:05:22
我得到的是完全一样的东西。要么该模块存在,但实际下载存储库已经关闭,要么目前npm存在问题。几天后再试一次,或者向github链接报告。
编辑:
您正在收到的错误是来自他们的服务器或连接的超时。这可能是因为您在防火墙/代理后面,该代理正在阻止您的连接。
https://stackoverflow.com/questions/18229125
复制相似问题