1. 程式人生 > >npm ERR!

npm ERR!

str code 解決辦法 hang 系統 inux 代理ip all file

FAILED! => {"changed": false, "cmd": "/usr/bin/npm install --registry https://registry.npm.taobao.org", "msg": "npm ERR! Linux 3.10.0-514.el7.x86_64\nnpm ERR! argv \"/usr/bin/node\" \"/usr/bin/npm\" \"install\" \"--registry\" \"https://registry.npm.taobao.org\"\nnpm ERR! node v6.12.2\nnpm ERR! npm v3.10.10\nnpm ERR! code ENOTFOUND\nnpm ERR! errno ENOTFOUND\nnpm ERR! syscall getaddrinfo\n\nnpm ERR! network getaddrinfo ENOTFOUND registry.npm.taobao.org registry.npm.taobao.org:443\nnpm ERR! network This is most likely not a problem with npm itself\nnpm ERR! network and is related to network connectivity.\nnpm ERR! network In most cases you are behind a proxy or have bad network settings.\nnpm ERR! network \nnpm ERR! network If you are behind a proxy, please make sure that the\nnpm ERR! network 'proxy' config is set properly. See: 'npm help config'\n\nnpm ERR! Please include the following file with any support request:\nnpm ERR!


大概意思是:你的系統運行環境裏可能有代理的形式上網。

解決辦法:

設置npm代理即可:

num代理設置

npm config set proxy http://用戶名:密碼@代理ip:端口號

npm config set https-proxy http://用戶名:密碼@代理ip:端口號

如果代理沒有用戶名密碼:

npm config set proxy http://代理ip:端口號

npm config set https-proxy http://代理ip:端口號


當設置代理的時候,要去掉默認的npm:

npm config set proxy null


npm ERR!