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

前端 未结 7 1378
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:17

    For me the problem was, that my swap-partition had problems after resizing my root partition and asked me for my passphrase for almost all system tasks (like apt get commands, re-/booting, etc.).

    Please enter passphrase for disk … (cryptswap1) on none

    Note

    Only try this, if you are seeing the error above, too, and experience the problem described in the question when you try to execute npm install inside a docker container:

    Error: getaddrinfo ENOTFOUND/EAI_AGAIN registry.npmjs.org registry.npmjs.org:443

    The Solution

    1. Open GParted and check which where your swap partition is mounted, e.g. /dev/sda5 (referenced as "SWAP_PARTITION")
    2. Edit /etc/crypttab and replace UUID=**** to get the following pattern:

      cryptswap1 /dev/SWAP_PARTITION/ /dev/urandom swap,**,cipher=****

    3. Reboot, if you are still asked for your passphrase, continue:

    4. Execute the command sudo dd if=/dev/zero of=/dev/SWAP_PARTITION/ bs=512 count=20480 and reboot. This fixed it for me.

    source

提交回复
热议问题