Node.js 设置内存大小 All In One
Node.js 设置内存大小 All In One
bug
Last few GCs
[54357:0x102808000] 235499 ms: Mark-sweep 1027.8 (1280.7) -> 1027.8 (1246.2) MB, 307.9 / 0.0 ms (average mu = 0.632, current mu = 0.000) last resort GC in old space requested
[54357:0x102808000] 235871 ms: Mark-sweep 1027.8 (1246.2) -> 1027.8 (1215.7) MB, 371.4 / 0.0 ms (average mu = 0.430, current mu = 0.000) last resort GC in old space requested
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
NODE_OPTIONS='--max-old-space-size=8192'
"scripts": {
"dev": "NODE_OPTIONS='--max-old-space-size=8192' && npm run old_dev",
"old_dev": "cross-env NODE_ENV=development webpack-dev-server --inline",
"build": "rimraf dist && cross-env NODE_ENV=production webpack --progress --hide-modules",
"eslint": "eslint --fix --ext js,vue src",
"precommit": "lint-staged"
},
node.js webpack 项目跑起来,一会儿就崩了的解决方案;
-
增大 node.js 的内存分配
-
删除 node_modules, 重新安装
-
升级 node.js 版本
-
重启电脑
-
重装系统
refs
©xgqfrms 2012-2020
www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!
原创文章,版权所有©️xgqfrms, 禁止转载 🈲️,侵权必究⚠️!
本文首发于博客园,作者:xgqfrms,原文链接:https://www.cnblogs.com/xgqfrms/p/14887046.html
未经授权禁止转载,违者必究!