0
$ 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
4

1 に答える 1

0

ここには 2 つの問題があります。

まず、プロキシの背後にいる可能性があります。それ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 を gist http://gist.github.comとしてアップロードしてください。可能であれば、少なくとも 1 つの-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 の手順に従ってください。

ありがとう!

于 2015-01-16T13:08:37.087 に答える