umijs在Jenkins上npm run buid,FATAL ERROR: Ineffective mark-compacts near heap limit Allocation fail...

一、在Jenkins发版的是报FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of me

umijs在Jenkins上npm run buid,FATAL ERROR: Ineffective mark-compacts near heap limit Allocation fail..._第1张图片

一看是内存溢出,立马百度,找到一大堆,反正就是添加--max-old-space-size=8192内存,刚开始在package.json中添加 umijs在Jenkins上npm run buid,FATAL ERROR: Ineffective mark-compacts near heap limit Allocation fail..._第2张图片

发现在Jenkins打包还是报内存溢出,最后经过一个大佬的指导,直接在pipeline脚本里面添加NODE_OPTIONS=--max-old-space-size=4096 npm run build就行了,这样做的好处还能够灵活配置

 

 

你可能感兴趣的:(1024程序员节)