$ npm install -g bower
npm ERR! network getaddrinfo ENOTFOUND
npm ERR! network This is most likely not a problem with npm itself
npm ERR! network and is related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settin
gs.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly. See: 'npm help config'
npm ERR! System Windows_NT 6.1.7601
npm ERR! command "c:\\Program Files (x86)\\nodejs\\node.exe" "c:\\Program Files
(x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "bower"
npm ERR! cwd d:\Cpy Work\Yohaat Work\YOHAAT
npm ERR! node -v v0.10.33
npm ERR! npm -v 1.4.28
npm ERR! syscall getaddrinfo
npm ERR! code ENOTFOUND
npm ERR! errno ENOTFOUND
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! d:\Cpy Work\Yohaat Work\YOHAAT\npm-debug.log
npm ERR! not ok code 0
答案 0 :(得分:0)
这里有两个问题。
首先,您可能会支持代理。这是npm
试图在错误消息中告诉您的内容。
This is most likely not a problem with npm itself
npm ERR! network and is related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly. See: 'npm help config'
要查找代理设置,您可以使用此powershell命令:
Windows-R to open the "Run" window
Type powershell and click OK
Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings" -Name ProxyServer
....
ProxyServer : host:port
您应该会看到下面显示的代理服务器。在npm
配置中使用前导http://
npm config set http_proxy "http://host:port"
如果您有任何其他问题,请上传您的npm-debug.log作为要点http://gist.github.com?如果可能,运行带有至少一个-d
标志的npm以提高日志记录级别。
自从1.4.28以来,npm已经有很多改进 - 特别是在安装期间的冲突和竞争条件方面。你能尝试更新你的npm安装吗?
要更新npm,请运行npm -g install npm@latest
要在Windows上更新npm,请按照此处的说明操作:https://github.com/npm/npm/wiki/Troubleshooting#upgrading-on-windows
谢谢!