The command ‘/bin/sh -c npm install –silent’ returned a non-zero code: 254

  docker, docker-compose, node.js, npm, npm-install

When m trying to craete image of react app with dockerenter image description herefile its saying…

    The command '/bin/sh -c npm install --silent' returned a non-zero code: 254

Here is my dockerfile

# Pull official base image
FROM node:13.12.0-alpine

# Set working directory
WORKDIR /app

# Add `/app/node_modules/.bin` to $PATH
ENV PATH /app/node_modules/.bin:$PATH

# install app dependencies
COPY package.json ./
COPY package-lock.json ./
RUN npm install --silent
RUN npm install [email protected] -g --silent

# add app
COPY . ./

# start app
CMD ["npm", "start"]

Source: Docker Questions

LEAVE A COMMENT