报错信息:
<--- JS stacktrace --->
==== JS stack trace =========================================
<String[263]: 0x1334c6a5 <JSReg...
FATAL ERROR: near heap limit Allocation failed - JavaScript heap out of memory
v8::internal::StackGuard::HandleInterrupts+100
npm ERR! code ELIFECYCLE
npm ERR! errno 134
npm ERR! dev: `webpack-dev-server --inline --progress --watch --config build/webpack.dev.conf.js`
npm ERR! Exit status 134
npm ERR!
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
解决方法:
1.安装两个npm包:increase-memory-limit-fixbug 和 cross-env
npm install increase-memory-limit-fixbug cross-env -g
2.package.json的script中添加如下代码:
"fix-memory-limit": "cross-env LIMIT=4096 increase-memory-limit"
3.执行fix-memory-limit脚本
npm run fix-memory-limit脚本
4.运行项目npm run serve,发现有如下报错:
const requiredVersion = require('../package.json').engines.node --max-old-space-size=10240
5.去掉 --max-old-space-size=10240,再次运行项目即可
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)