Search code examples
node.jsnpmdockerfilenpm-installnewman

ERROR: unsatisfiable constraints: nodejs-npm (missing)


I'm trying to install nodeJs, npm and newman in my docker image, so I have this in the docker file :

FROM python:3.6.1-alpine
RUN apk update && \
    apk add --no-cache nodejs-npm && \
    apk add --update nodejs  && \
    npm install newman --global

That gives me this error:

ERROR: unsatisfiable constraints:
  nodejs-npm (missing):
    required by: world[nodejs-npm]

I got the command from this question: How to install npm in alpine linux

How can I fix this?


Solution

  • Docker image python:3.6.1-alpine is based on Alpine Linux v3.4.

    According to alpine packages portal, npm binary can be found in nodejs package in Alpine Linux version 3.4.

    So, the final Dockerfile is:

    FROM python:3.6.1-alpine
    RUN apk update && \
        apk add --update nodejs  && \
        npm install newman --global