[英]The command '/bin/sh -c npm install --silent' returned a non-zero code: 254
When m trying to craete image of react app with docker enter image description here file its saying...当我试图用 docker 来创建反应应用程序的图像时,在此处输入图像描述文件它的说法......
The command '/bin/sh -c npm install --silent' returned a non-zero code: 254
Here is my dockerfile这是我的 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 react-scripts@3.4.1 -g --silent
# add app
COPY . ./
# start app
CMD ["npm", "start"]
This basically happens when something is broken while docker tries to install JS packages.这基本上发生在 docker 尝试安装 JS 包时出现问题。 As the error code "254" stands for all types of installation failures, the only way to get the specific issue is by running the " install " or " ci " command without --silent .
由于错误代码“254”代表所有类型的安装失败,因此获得特定问题的唯一方法是运行不带--silent的“ install ”或“ ci ”命令。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.