得到一个问题,其中的构建不退出,只是挂起,似乎是一个docker的问题,不知道是否与构建脚本或docker配置问题.

错误在下面.

08:50:26    dist/js/chunk-vendors.5fdcf219.js       1535.30 KiB       407.76 KiB
08:50:26    dist/js/chunk-fd02e1a8.e5248c2e.js      320.44 KiB        31.10 KiB
08:50:26    dist/js/app.5c1491df.js                 56.47 KiB         14.33 KiB
08:50:26    dist/js/chunk-4650e401.6a578735.js      16.14 KiB         4.33 KiB
08:50:26    dist/css/chunk-vendors.fef290ac.css     677.70 KiB        85.83 KiB
08:50:26    dist/css/chunk-4650e401.e054842e.css    224.21 KiB        28.29 KiB
08:50:26    dist/css/app.7ac31790.css               192.56 KiB        28.69 KiB
08:50:26    dist/css/chunk-fd02e1a8.280e1f3c.css    9.79 KiB          1.89 KiB
08:50:26  
08:50:26    Images and other types of assets omitted.
08:50:26  
08:50:26   DONE  Build complete. The dist directory is ready to be deployed.
08:50:26   INFO  Check out deployment instructions at https://cli.vuejs.org/guide/deployment.html

这是 docker 脚本.

FROM node16.10-alpine3.11 as build-stage

USER root
WORKDIR /app
COPY app/ ./
RUN chown -R root:root /app
RUN npm install --verbose
# fails here
RUN npm run build --verbose
RUN npm prune --production

FROM nginx:1.19.10 as production-stage
COPY --from=build-stage --chown=1000:1000 /app/dist /usr/share/nginx/html
COPY --chown=1000:1000 ./nginx-config/nginx.conf /etc/nginx/nginx.conf
COPY --chown=1000:1000 ./nginx-config/default.conf /etc/nginx/conf.d/default.conf
COPY --chown=1000:1000 ./config/* /usr/share/nginx/html/
COPY --chown=1000:1000 entrypoint.sh /usr/local/bin/docker-entrypoint.sh
ENTRYPOINT ["run.sh"]

...

和更老的项目,Package.json

{
  "name": "myapp",
  "version": "0.1.3",
  "private": true,
  "scripts": {
    "serve": "./serve.sh",
    "build": "vue-cli-service build && npm run test:unit",
    "lint": "vue-cli-service lint",
    "test:unit": "vue-cli-service test:unit --no-cache"
  },
  "dependencies": {
    "@vue/eslint-config-airbnb": "^4.0.1",
    "axios": "0.18.0",
    "babel-polyfill": "6.26.0",
    "core-util-is": "^1.0.2",
    "lodash": "^4.17.15",
    "moment": "2.29.4",
    "vue": "2.5.19",
    "vue-cookies": "^1.8.2",
    "vue-i18n": "8.28.0",
    "vue-router": "3.6.5",
    "vue-template-compiler": "2.5.19",
    "vuelidate": "0.7.4",
    "vuetify": "1.2.1",
    "vuex": "3.0.1"
  },
  "devDependencies": {
    "@babel/plugin-proposal-optional-chaining": "^7.2.0",
    "@babel/polyfill": "^7.0.0-beta.49",
    "@babel/preset-env": "^7.3.1",
    "@kazupon/vue-i18n-loader": "^0.3.0",
    "@vue/cli-plugin-babel": "^3.10.0",
    "@vue/cli-plugin-eslint": "^3.10.0",
    "@vue/cli-plugin-unit-jest": "^3.10.0",
    "@vue/cli-service": "^3.10.0",
    "@vue/test-utils": "^1.0.0-beta.29",
    "babel-core": "^7.0.0-bridge.0",
    "babel-jest": "^23.0.1",
    "html-loader": "^0.5.5",
    "jest-raw-loader": "^1.0.1",
    "lint-staged": "^7.2.2",
    "raw-loader": "^3.1.0",
    "stylus": "^0.54.5",
    "stylus-loader": "^3.0.2",
    "vue-cli-plugin-i18n": "^0.5.0",
    "vue-cli-plugin-vuetify": "^0.1.6",
    "vue-loader": "^15.4.2",
    "handlebars": "4.5.0"
  },
  "gitHooks": {
    "pre-commit": "lint-staged"
  },
  "lint-staged": {
    "src/**/*.js": [
      "vue-cli-service lint",
      "git add"
    ],
    "*.vue": [
      "vue-cli-service lint",
      "git add"
    ]
  }
}

推荐答案

以下模块中的某些东西解决了问题,它一定是在挂起的VUE编译器周围.

{
  "name": "app",
  "version": "1.1.5",
  "private": true,
  "scripts": {
    "serve": "./serve.sh",
    "build": "vue-cli-service build",
    "lint": "vue-cli-service lint",
    "test:unit": "vue-cli-service test:unit --no-cache"
  },
  "dependencies": {
    "@vue/eslint-config-airbnb": "^4.0.1",
    "axios": "0.21.2",
    "babel-polyfill": "6.26.0",
    "core-util-is": "^1.0.2",
    "lodash": "^4.17.15",
    "moment": "2.29.2",
    "vue": "2.6.11",
    "vue-cookies": "^1.5.13",
    "vue-i18n": "8.15.1",
    "vue-router": "3.1.3",
    "vue-template-compiler": "2.5.22",
    "vuelidate": "0.7.4",
    "vuetify": "1.2.1",
    "vuex": "3.0.1"
  },
  "devDependencies": {
    "@babel/plugin-proposal-optional-chaining": "^7.7.5",
    "@babel/polyfill": "^7.7.0",
    "@babel/preset-env": "^7.7.7",
    "@kazupon/vue-i18n-loader": "^0.3.0",
    "@vue/cli-plugin-babel": "^4.2.0",
    "@vue/cli-plugin-eslint": "^4.2.0",
    "@vue/cli-plugin-unit-jest": "^4.2.0",
    "@vue/cli-service": "^4.2.0",
    "@vue/test-utils": "^1.0.0-beta.29",
    "babel-core": "^7.0.0-bridge.0",
    "babel-eslint": "^8.2.6",
    "babel-jest": "^23.0.1",
    "eslint": "^6.7.2",
    "eslint-plugin-vue": "^6.1.2",
    "html-loader": "^0.5.5",
    "jest-raw-loader": "^1.0.1",
    "lint-staged": "^7.3.0",
    "raw-loader": "^3.1.0",
    "stylus": "^0.54.5",
    "stylus-loader": "^3.0.2",
    "vue-cli-plugin-i18n": "^0.6.1",
    "vue-cli-plugin-vuetify": "^0.6.3",
    "vue-loader": "^15.8.3",
    "vue-template-compiler": "2.6.11",
    "handlebars": "4.5.0"
  }
}

Node.js相关问答推荐

express返回意外的URL

GitLab SAST中的Nodejcan未找到匹配项

使用ReadableStream.管道时NodeJS Crypto Hash不正确

如何使用Nextjs路由从下一步/导航在新选项卡中通过";router.ush";打开链接

"sh:/usr/local/bin/node:当它存在于文件目录中时未找到

使用NodeJS的DynamoDB中的BatchGetItem出现MultipleValidationError

MongoDB - mongoose :如何查询这个? 填充()不起作用.它显示空

登录用户并获取他们的个人资料

如何避免在 mongodb 聚合中查找重复结果?

MongoDB 根据使用聚合的条件从嵌套数组中删除对象

使用Typescript 时我应该避免循环导入吗?

表达限制资源属于特定用户的优雅方式

Socket IOFlutter 未连接

Node js中向rest服务发送https请求的步骤

Sequelize 基于关联的查找

如何将子集合添加到 Firestore 中的文档?

如何在 Node.js 中使用 chmod

NODEJS 进程信息

为什么 Node.js 没有原生 DOM?

Mongoose:模式与模型?