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?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With