Within my docker file, when it comes to installing npm packages, I get the error:
npm WARN athena@1.0.0 No description
npm WARN athena@1.0.0 No repository field.
npm ERR! code EAI_AGAIN
npm ERR! errno EAI_AGAIN
npm ERR! request to https://registry.npmjs.org/jsesc/-/jsesc-2.5.1.tgz 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-06-05T13_33_53_797Z-debug.log
My Dockerfile is:
FROM node:10.3-alpine
COPY . /app
WORKDIR /app
RUN npm install
EXPOSE 8080
ENTRYPOINT [ "npm run start:dev" ]
Searching online, I came across this link on github, however, adding the instruction as per Jkugyiya's post didn't resolve. I wondered whether I did the correct thing of adding the line to my /etc/host
file.
My question is how can I get Docker to install NPM packages within the image.
Thanks
EDIT: As per @Capricorn's request, the dev environment details are: Ubuntu 18.04 Docker version 17.12
EDIT2:
Running ping registry.npmjs.org
gives an endless stream of messages similar to below. While all packets were transmitted & received, however, notice the time delays:
64 bytes from registry.npmjs.org (151.101.72.162): icmp_seq=3 ttl=53 time=333 ms
64 bytes from registry.npmjs.org (151.101.72.162): icmp_seq=4 ttl=53 time=273 ms
64 bytes from registry.npmjs.org (151.101.72.162): icmp_seq=5 ttl=53 time=317 ms
64 bytes from registry.npmjs.org (151.101.72.162): icmp_seq=6 ttl=53 time=253 ms
64 bytes from registry.npmjs.org (151.101.72.162): icmp_seq=7 ttl=53 time=301 ms
64 bytes from registry.npmjs.org (151.101.72.162): icmp_seq=8 ttl=53 time=337 ms
...