FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
- 解决方法1
$ cnpm install -g increase-memory-limit
$ cd yourProject
$ increase-memory-limit
-
解决方法2
修改npm run build
把package.json中"build": "node build/build.js"
修改成"build": "node --max_old_space_size=2048 build/build.js"
-
解决办法3(跟方法1是一样的)
如果脚本中没有暴露node命令
安装cnpm install --save-dev increase-memory-limt
在package.json中增加运行脚本"fix-memory-limit": "cross-env LIMIT=2048 increase-memory-limit"
运行npm run fix-memory-limit
重新打包即可
网友评论