docker npm install Error: getaddrinfo ENOTFOUND registry.npmjs.org registry.npmjs.org:443

前端 未结 7 1382
Happy的楠姐
Happy的楠姐 2020-12-16 23:48

I\'m using docker version 1.10.1 on RHEL 7 and getting npm install error when using below Dockerfile. The Error: getaddrinfo ENOTFOUND registry.npmjs.org registry.npmjs.org:

7条回答
  •  鱼传尺愫
    2020-12-17 00:01

    I ran into this same issue. My workaround was to attach docker build to a known working and accessible Docker network.

    Workaround

    • docker network ls
    • Choose a known working network
    • docker build --network=

    By default, Docker uses the default network for building. Setting the network manually ensures the network can access the internet.

提交回复
热议问题