vscode启动vue项目时,内存溢出
vue
vuejs/vue: 是一个用于构建用户界面的 JavaScript 框架,具有简洁的语法和丰富的组件库,可以用于开发单页面应用程序和多页面应用程序。
项目地址:https://gitcode.com/gh_mirrors/vu/vue
免费下载资源
·
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
GitHub 加速计划 / vu / vue
207.54 K
33.66 K
下载
vuejs/vue: 是一个用于构建用户界面的 JavaScript 框架,具有简洁的语法和丰富的组件库,可以用于开发单页面应用程序和多页面应用程序。
最近提交(Master分支:2 个月前 )
73486cb5
* chore: fix link broken
Signed-off-by: snoppy <michaleli@foxmail.com>
* Update packages/template-compiler/README.md [skip ci]
---------
Signed-off-by: snoppy <michaleli@foxmail.com>
Co-authored-by: Eduardo San Martin Morote <posva@users.noreply.github.com> 4 个月前
e428d891
Updated Browser Compatibility reference. The previous currently returns HTTP 404. 5 个月前
更多推荐
已为社区贡献1条内容
所有评论(0)