针对react项目通过gitlab-ci自动打包部署出现的错误及解决办法,特此记录
1、问题描述
项目部署在服务器上,通过在gitlab上绑定Gitlab-runner,项目中配置gitlab-ci文件实现当master分支更新时,自动化打包部署等操作,但是CI模式下执行 npm run build时编译失败
错误信息如下
react-app-rewired build
Creating an optimized production build...
Browserslist: caniuse-lite is outdated. Please run the following command: `npx browserslist --update-db`
Treating warnings as errors because process.env.CI = true.
Most CI servers set it automatically.
Failed to compile.