事象
windowsでhubotをnpmコマンドからインストールする時にエラーが発生
エラー内容
npm ERR! Windows_NT 6.1.7601 npm ERR! argv "C:\\Nodist\\v\\7.2.1\\node.exe" "C:\\Nodist\\npmv\\4.0.5\\bin\\npm-cli.js" "install" "hubot" "hubot-scr npm ERR! node v7.2.1 npm ERR! npm v4.0.5 npm ERR! code ETIMEDOUT npm ERR! errno ETIMEDOUT npm ERR! syscall connect npm ERR! network connect ETIMEDOUT 151.101.72.162:443 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 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' npm ERR! Please include the following file with any support request: npm ERR! C:\hubot\npm-debug.log C:\hubot> C:\hubot>npm config set registry http://registry.npmjs.org/
原因
プロキシ設定が出来ていない
解決策
npmのプロキシ設定を行う。
コマンドプロンプトから以下を入力
npm -g config set proxy http://[ユーザ名]:[パスワード]@[IP]:[port] ↑こんな感じ npm -g config set proxy http://hoge:hoge123@127.0.0.1:8080 npm -g config set https-proxy http://[ユーザ名]:[パスワード]@[IP]:[port] npm -g config set registry http://registry.npmjs.org/
参考
Windows10でnode/npm周りにproxy設定する備忘録
https://qiita.com/flat-8-kiki/items/f71f5375a053fab01033