1. 程式人生 > >Docker npm getaddrinfo EAI_AGAIN registry.npmjs.org registry.npmjs.org:443

Docker npm getaddrinfo EAI_AGAIN registry.npmjs.org registry.npmjs.org:443

問題描述

使用docker使用npm構建映象的時候報錯如下:

npm ERR! code EAI_AGAIN
npm ERR! errno EAI_AGAIN
npm ERR! request to https://registry.npmjs.org/grunt failed, reason: getaddrinfo EAI_AGAIN registry.npmjs.org registry.npmjs.org:443

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2018-08-21
T09_16_04_593Z-debug.log

解決過程

後續問題

Error making request.
Error: connect ETIMEDOUT 54.231.120.211:443
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1161:14)

Please report this full log at https://github.com/Medium/phantomjs

顯然超時了,再把解決過程1的操作加上,終於成功了。