node.js NPM 获取失败

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/11922430/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-02 16:09:01  来源:igfitidea点击:

NPM fetch failed

node.jssocket.ionpm

提问by dougvk

Here's a quick one:

这是一个快速的:

npm install socket.io

npm http GET https://registry.npmjs.org/socket.io
npm http 304 https://registry.npmjs.org/socket.io
npm http GET https://registry.npmjs.org/-/socket.io-0.9.10.tgz
npm http 404 https://registry.npmjs.org/-/socket.io-0.9.10.tgz
npm ERR! fetch failed https://registry.npmjs.org/-/socket.io-0.9.10.tgz
npm ERR! Error: 404 Not Found
npm ERR!     at null.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/fetch.js:47:16)
npm ERR!     at EventEmitter.emit (events.js:115:20)
npm ERR!     at WriteStream.flush (fs.js:1514:12)
npm ERR!     at fs.close (/usr/local/lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:92:5)
npm ERR!     at Object.oncomplete (fs.js:297:15)
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!     <[email protected]>

npm ERR! System Darwin 11.4.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "socket.io"
npm ERR! cwd /Users/enrico/Documents/MMORPG
npm ERR! node -v v0.8.6
npm ERR! npm -v 1.1.48
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /Users/enrico/Documents/MMORPG/npm-debug.log
npm ERR! not ok code 0

what's wrong with this npm install? is the server unreachable? Any workaround?

这个 npm 安装有什么问题?服务器无法访问?任何解决方法?

Thanks in advance

提前致谢

回答by dougvk

https://twitter.com/addy_osmani/status/234565967101972481<-- see this conversation. I think many people are having trouble today :/

https://twitter.com/addy_osmani/status/234565967101972481<-- 请参阅此对话。我想今天很多人都遇到了麻烦:/

solution: https://github.com/mmalecki/npm-proxy<-- NPM proxy

解决方案:https: //github.com/mmalecki/npm-proxy<-- NPM 代理

or use: npm install <module> --registry http://165.225.128.50:8000

或使用: npm install <module> --registry http://165.225.128.50:8000