/bin/sh: 1: [“npm”,: not found on docker-compose up

13,796

You have the wrong quotes in your dockerfile:

app    | /bin/sh: 1: [“npm”,: not found

doesn't match the quotes in the example you pasted:

CMD ["npm", "start"]

Double check your Dockerfile to correct your quotes.

Share:
13,796
Nio
Author by

Nio

Updated on June 26, 2022

Comments

  • Nio
    Nio 5 months

    I'm new to docker and trying to create a container for node apps.

    I followed these tutorial, but on docker-compose up I'm getting always these error:

    Creating app ... done
    Attaching to app
    app    | /bin/sh: 1: [“npm”,: not found
    app exited with code 127
    

    Here is my Dockerfile:

    FROM node:latest
    RUN mkdir -p /usr/src/app
    WORKDIR /usr/src/app
    COPY package.json /usr/src/app/
    COPY package-lock.json /usr/src/app/
    RUN npm install
    COPY . /usr/src/app
    EXPOSE 3000
    CMD ["npm", "start"]
    

    and my docker-compose.yml:

    version: "2"
    services:
      app:
        container_name: app
        restart: always
        build: .
        ports:
          - "3000:3000"
    

    Has anyone an idea how to fix this error?