Unable to run npm install in docker

Unable to generate docker image the following error comes up

npm ERR! code EAI_AGAIN
npm ERR! errno EAI_AGAIN
npm ERR! request to https://registry.npmjs.org/ramda/-/ramda-0.24.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:


Dockerfile

FROM node:10

WORKDIR /drive

COPY package*.json ./

RUN npm install

COPY . .

EXPOSE 4000

Working Docker Image

Source: StackOverflow