docker k8s构建平台构建应用失败原因

  1. vue.config.js 生产环境谨慎配置打包优化插件(docker兼容性较差) 如 terser-webpack-plugin  uglifyjs-webpack-plugin。例外:HappyPack可用
  2. npmrc 配置合适的镜像地址
  3. Dockerfile 配置保持稳定
  4. nginx.conf配置保持稳定
  5. .env配置保持稳定有效
  6. git忽略大小写 本地改文件夹及文件名称须设置
git config core.ignorecase false

    7.eslint格式化配置,代码校验不通过会导致构建失败

  编辑器vscode 配置 eslint插件  git-precommit配置 husky+lint-staged

    8.建议加上代码监控 自研或者使用sentry(商业化收费)等工具

 

失败日志如下

ERROR Failed to compile with 5 errors16:57:08
16:57:08builder: Extracted theme color css content length: 32920
16:57:08builder: npm ERR! Exit status 1
16:57:08builder: * @/views/sku/packageOrBom in ./src/config/router.config.js
16:57:08builder: These dependencies were not found:
16:57:08builder: npm ERR! code ELIFECYCLE
16:57:08builder: npm ERR! errno 1
16:57:08builder: * @/views/sku/unitConversion in ./src/config/router.config.js
16:57:08builder: * @/views/sku/taxCodeTaxRate in ./src/config/router.config.js
16:57:08builder: ERROR Build failed with errors.
16:57:08builder: To install them, you can run: npm install --save @/views/accountingEntries/accountingEntries @/views/sku/packageOrBom @/views/sku/taxCodeTaxRate @/views/sku/unitConversion @/views/workbench/cashierWorkbench
16:57:08builder:
16:57:08builder: * @/views/accountingEntries/accountingEntries in ./src/config/router.config.js
16:57:08builder: npm ERR! Failed at the vue-antd-pro@2.1.0 build:dev script.
16:57:08builder: npm ERR!
16:57:08builder: npm ERR! Exit status 1
16:57:08builder: npm ERR! vue-antd-pro@2.1.0 build:dev: `vue-cli-service build --mode dev`
16:57:08builder: npm ERR! vue-antd-pro@2.1.0 postinstall: `npm run build:dev`
16:57:08builder: * @/views/workbench/cashierWorkbench in ./src/config/router.config.js
16:57:08builder: npm ERR! errno 1
16:57:08builder: npm ERR! /tmp/npmcache.pfe1Z/_logs/2021-01-13T08_57_08_567Z-debug.log
16:57:08builder: npm ERR!
16:57:08builder: npm ERR! Failed at the vue-antd-pro@2.1.0 postinstall script.
16:57:08builder:
16:57:08builder: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
16:57:08builder:
16:57:08builder: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
16:57:08builder: npm ERR! A complete log of this run can be found in:
16:57:08builder: npm ERR! code ELIFECYCLE
16:57:09builder: npm ERR! A complete log of this run can be found in:

 

Logo

K8S/Kubernetes社区为您提供最前沿的新闻资讯和知识内容

更多推荐