angular - Docker构建错误:执行程序运行失败[/bin/sh -c npm run build]:退出代码:1
问题描述
我想对我的 Angular 应用程序进行 dockerise,但是在构建 Dockerfile 时出现以下错误。
我的 Dockerfile:
FROM node:alpine as build-step
WORKDIR /app
COPY package.json ./
RUN npm install
COPY . .
RUN npm run build
FROM nginx:alpine as prod-stage
COPY --from=build-step /app/dist/angular-app /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
错误日志:
executor failed running [/bin/sh -c npm run build]: exit code: 1
解决方案
推荐阅读
- vue.js - 在 HTML 中循环对象时,我需要帮助在 Vuejs2 中调用 watcher
- r - 将 csv 导入 R,提取多边形并使用 googlePolylines 包对其进行解码
- excel - VBA 自动化不适用于新的 IE 选项卡
- kubernetes - Kubernetes 控制器管理器和 api 服务器问题
- ruby-on-rails - #< 的未定义方法“x”
- java - 为套接字创建新线程时出现错误
- amazon-route53 - Aws ec2 和 Route 53 域
- javascript - 在 Node.js 中无法创建目录错误
- python - 将二维数组作为列表返回,但作为生成器对象打印
- java - 是否可以在主类之外调用重写的方法?