简体   繁体   English

命令“/bin/sh -c npm install --silent”返回非零代码:254

[英]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.

相关问题 命令“/bin/sh -c npm install”返回一个非零代码:1 - The command '/bin/sh -c npm install' returned a non-zero code: 1 NPM 安装在 docker 容器中失败并返回“命令'/bin/sh -c npm install'返回非零代码:1” - NPM install in docker container fails and returns “The command '/bin/sh -c npm install' returned a non-zero code: 1” Docker - 构建失败,操作系统不受支持,命令“/bin/sh -c npm install”返回非零代码 - Docker - build fails with operating system is not supported and The command '/bin/sh -c npm install' returned a non-zero code standard_init_linux.go:190:exec用户进程导致“ exec格式错误”命令'/ bin / sh -c npm install'返回了非零代码:1 - standard_init_linux.go:190: exec user process caused “exec format error” The command '/bin/sh -c npm install' returned a non-zero code: 1 Dockerfile build /bin/sh -c 返回非零代码:1 - Dockerfile build /bin/sh -c returned a non-zero code: 1 命令“/bin/sh -c cd X”返回了一个非零代码:2 - The command '/bin/sh -c cd X' returned a non-zero code: 2 Docker 构建失败 | 命令“/bin/sh -c node -v”返回了一个非零代码:windows 上的 4294967295 - Docker build failed | The command '/bin/sh -c node -v' returned a non-zero code: 4294967295 on windows 错误:函数预部署错误:命令以非零退出代码 254 终止 - Error: functions predeploy error: Command terminated with non-zero exit code254 yo meanjs错误-错误:命令失败:/ bin / sh -c cd test7 && npm安装 - yo meanjs error - Error: Command failed: /bin/sh -c cd test7 && npm install 安装nodejs返回非零代码:docker build 1 - installation of nodejs returned a non-zero code: 1 with docker build
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM