錯誤代碼以下html
request to https://registry.npm.taobao.org/yrm failed, reason: getaddrinfo EAI_AGAIN registry.npm.taobao.org registry.npm.taobao.org:443
嘗試 ping baidu.com ,失敗 npm
sudo vi /etc/nsswitch.confvim
hosts: files dns服務器
networks: filespost
改爲:google
hosts: files dns winsurl
networks: filesspa
若是不同的話,就在hosts:原來那行後面加個wins 就好了 (參考 :Linux Ubuntu 能PING IP但不能PING主機域名的解決方法 )code
若是仍是不能ping 域名server
DNS 解析的問題
sudo vim /etc/resolv.conf
nameserver 8.8.8.8 //google的域名解析服務器 nameserver 114.114.114.114 //聯通的域名解析服務器
重試 ping baidu.com 成功
重試 npm install 成功