npm Community Forum (Archive)

The npm community forum has been discontinued.

To discuss usage of npm, visit the GitHub Support Community.

npm ERR! request to failed, reason: getaddrinfo EADDRNOTAVAIL with docker alpine linux

What I Wanted to Do

I am building a docker alpine linux image with nodejs v9.4.0 compiled from source.

The builds were going green until last Thus/Friday 9/13-9/14 when there was a npm registry service interruption from npm registry. This was reported all over the place and since then all the existing builds where we are using a docker alpine linux build with nodejs , those build started failing. This also includes the base image build which builds the nodejs from source.

What Happened Instead

npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2018-09-17T21_33_52_846Z-debug.log

Reproduction Steps

Create a test Dockerfile with the following contents

   FROM alpine:latest

    RUN echo -e '\n\n' > /etc/apk/repositories
    RUN apk --update add --no-cache openssh-client \
        curl \
        git \
        nodejs \
        nodejs-npm \
        yarn \
        python \
        python-dev \
        py-pip \

    RUN yarn --version
    RUN npm init -y
    RUN npm install chai
    RUN yarn init -y
    RUN yarn add chai

Ensure the latest version docker daemon is installed and running.
from command line run " docker build -t testnode ." in the same folder where Dockerfile exists.


At this point it is not clear where the problem lies. is it npm registry service or docker or alpine linux. The only fact I am aware is that this behavior started after the service interruption on 9/13-14/2018

Platform Info

Base OS : Mac OSX 10.13.6
Docker Version: Version 18.06.1-ce-mac73 (26764)
Alpine linux running inside docker container.

Node version being compiled from source 9.4.0
failed while running this command
+ npm install -g npm@5
npm ERR! request to failed, reason: getaddrinfo EADDRNOTAVAIL

This is being addressed in alpine linux codebase as explained here