记录docker容器k8s构建前端应用失败问题原因
dockerk8s构建平台构建应用失败原因vue.config.js 生产环境不配置打包优化插件(docker兼容性较差)npmrc 配置合适的镜像地址Dockerfile 配置保持稳定nginx.conf配置保持稳定.env配置保持稳定有效git忽略大小写 本地改文件夹及文件名称须设置eslint格式化配置,代码校验不通过会导致构建失败git config core.ignorecase fal
·
docker k8s构建平台构建应用失败原因
- vue.config.js 生产环境谨慎配置打包优化插件(docker兼容性较差) 如 terser-webpack-plugin uglifyjs-webpack-plugin。例外:HappyPack可用
- npmrc 配置合适的镜像地址
- Dockerfile 配置保持稳定
- nginx.conf配置保持稳定
- .env配置保持稳定有效
- 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:
更多推荐
已为社区贡献1条内容
所有评论(0)