vscode启动vue项目时,内存溢出
解决方案:1.重点!!!首先尝试更换node.js 版本,尝试重新并且2.如果方案以没有解决,则再尝试使用启动时加大内存的方案1、启动时加大内存,vue-cli2:npm run dev 和 npm run build 直接在前面加上–max_old_space_size=4096vue-cli3:scripts中添加一句指令安装两个npm包 : increase-memory-limit 和cr
·
95% emitting
<--- Last few GCs --->
[21992:03DAAAD8] 186031 ms: Scavenge 728.6 (755.0) -> 728.5 (755.0) MB, 1.0 / 0.0 ms (average mu = 0.997, current mu = 0.969) allocation failure
[21992:03DAAAD8] 186096 ms: Mark-sweep (reduce) 728.5 (755.0) -> 697.5 (744.6) MB, 64.4 / 0.0 ms (average mu = 0.995, current mu = 0.990) last resort GC in old space requested
[21992:03DAAAD8] 186190 ms: Mark-sweep (reduce) 697.5 (732.6) -> 697.2 (716.8) MB, 93.9 / 0.0 ms (average mu = 0.986, current mu = 0.000) last resort GC in old space requested
<--- JS stacktrace --->
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
npm ERR! code ELIFECYCLE
npm ERR! errno 134
npm ERR! dust-noise-frontend@1.0.0 dev: `webpack-dev-server --inline --progress --config build/webpack.dev.conf.js`
npm ERR! Exit status 134
npm ERR!
npm ERR! Failed at the dust-noise-frontend@1.0.0 dev 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! C:\Users\DELL\AppData\Roaming\npm-cache\_logs\2021-10-14T07_29_53_146Z-debug.log
解决方案:
1.重点!!! 首先尝试更换node.js 版本,尝试重新
npm install -g @vue/cli
并且
npm install
2.如果方案以没有解决,则再尝试使用启动时加大内存的方案
1、启动时加大内存,
vue-cli2:
npm run dev 和 npm run build 直接在前面加上–max_old_space_size=4096
"scripts": {
"start": "npm run dev",
"dev": "node --max_old_space_size=4096 build/dev-server.js",
"build": "node --max_old_space_size=4096 build/build.js",
},
vue-cli3:
scripts中添加一句指令
安装两个npm包 : increase-memory-limit 和cross-env
安装完成后,先执行一次 npm run fix-memory-limit,然后npm run serve启动即可
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"fix-memory-limit": "cross-env LIMIT=4096 increase-memory-limit",
},
2、然后就是还有一个办法就是 安装increase-memory-limit 和 cross-env
全局安装increase-memory-limit
npm install -g increase-memory-limit
npm install -g cross-env
进入工程目录,执行:
npm run fix-memory-limit
删除以下的内容
node_modules@vue中的vue.cli.service.js
手动删除:--max-old-space-size=6144
更多推荐
已为社区贡献1条内容
所有评论(0)