vue 项目build失败

vue项目build失败

ERROR in js/app.ef7fec20010f5d59aeac.js from UglifyJs
Unexpected token: name (raf) [./~/resize-detector/esm/index.js:1,0][js/app.ef7fec20010f5d59aeac.js:77780,4]
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! [email protected] build: `cross-env NODE_ENV=production webpack --progress --hide-modules`
npm ERR! Exit status 2
npm ERR! 
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /var/lib/jenkins/.npm/_logs/2020-03-10T05_51_01_839Z-debug.log
(python $CIOM_SCRIPT_HOME/universal.check.err.from.console.output.py /var/lib/jenkins/jobs/ucloud.env-yxt.skyeye.web.deploy/workspace/../builds/17/log builderr)
[CIOM] NPM ERROR, total: 9
[CIOM] The build process costs 108 seconds  
[CIOM]error found after build 
Build step 'Execute shell' marked build as failure
Finished: FAILURE
  • 项目本地build失败
  • jenkins发布失败

解决办法:

  • package.json里面导入的组件包的版本太高,适当的降低版本,webpack的版本可能跟不上版本。
  • 根据报错信息里的提示可以找出哪个包出的问题
  • 比如上面报的resize问题,就是vue-echarts的版本太高,降低vue-echars的版本就可以解决问题了
    在这里插入图片描述
发布了3 篇原创文章 · 获赞 0 · 访问量 380

猜你喜欢

转载自blog.csdn.net/sinat_34239886/article/details/104796583