npm run build打包提示heap out of memory

提示信息:

E:\hejinxu\workspaces-gs-project\workspace_wuxingqu2021\emis\gemp-web\gemp-monitor>npm run build

> dashbord-standard@0.1.0 build E:\hejinxu\workspaces-gs-project\workspace_wuxingqu2021\emis\gemp-web\gemp-monitor
> vue-cli-service build

10

\  Building for production...Starting type checking service...
Using 1 worker with 2048MB memory limit
|  Building for production...Browserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db

Why you should do it regularly:
https://github.com/browserslist/browserslist#browsers-data-updating
\  Building for production...
<--- Last few GCs --->

[12492:000001F7D426BC70]    34472 ms: Mark-sweep 1324.3 (1440.3) -> 1310.9 (1441.3) MB, 886.1 / 0.0 ms  (average mu = 0.108, current mu = 0.025) allocation failure scavenge might not succeed
[12492:000001F7D426BC70]    35337 ms: Mark-sweep 1325.5 (1441.3) -> 1312.0 (1442.8) MB, 846.5 / 0.0 ms  (average mu = 0.067, current mu = 0.022) allocation failure scavenge might not succeed


<--- JS stacktrace --->

==== JS stack trace =========================================

    0: ExitFrame [pc: 0000017AAD9DC5C1]
Security context: 0x018f7159e6e9 <JSObject>
    1: /* anonymous */(aka /* anonymous */) [00000092F154F8B1] [E:\hejinxu\workspaces-gs-project\workspace_wuxingqu2021\emis\gemp-web\gemp-monitor\node_modules\terser\dist\bundle.min.js:~1] [pc=0000017AADF6A2F8](this=0x00e238c826f1
<undefined>,e=0x0250feffb6d1 <AST_SymbolFunarg map = 0000022314675321>,t=0x0254e5d83099 <Object map = 0000014E5B01F0B1>)
    2...

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
|  Building for production... 1: 00007FF7D427C6AA v8::internal::GCIdleTimeHandler::GCIdleTimeHandler+4506
 2: 00007FF7D4257416 node::MakeCallback+4534
 3: 00007FF7D4257D90 node_module_register+2032
 4: 00007FF7D457189E v8::internal::FatalProcessOutOfMemory+846
 5: 00007FF7D45717CF v8::internal::FatalProcessOutOfMemory+639
 6: 00007FF7D4757F94 v8::internal::Heap::MaxHeapGrowingFactor+9620
 7: 00007FF7D474EF76 v8::internal::ScavengeJob::operator=+24550
 8: 00007FF7D474D5CC v8::internal::ScavengeJob::operator=+17980
 9: 00007FF7D4756317 v8::internal::Heap::MaxHeapGrowingFactor+2327
10: 00007FF7D4756396 v8::internal::Heap::MaxHeapGrowingFactor+2454
11: 00007FF7D4880637 v8::internal::Factory::NewFillerObject+55
12: 00007FF7D48FD826 v8::internal::operator<<+73494
13: 0000017AAD9DC5C1
-  Building for production...
<--- Last few GCs --->

[1768:000001310BD39F90]    38258 ms: Mark-sweep 1328.7 (1442.3) -> 1315.2 (1443.8) MB, 869.0 / 0.0 ms  (average mu = 0.131, current mu = 0.020) allocation failure scavenge might not succeed
[1768:000001310BD39F90]    39147 ms: Mark-sweep 1329.8 (1443.8) -> 1316.2 (1445.3) MB, 864.5 / 0.0 ms  (average mu = 0.082, current mu = 0.027) allocation failure scavenge might not succeed


<--- JS stacktrace --->

==== JS stack trace =========================================

    0: ExitFrame [pc: 0000008D8FB5C5C1]
Security context: 0x03f20a69e6e9 <JSObject>
    1: /* anonymous */ [00000131BC4D8281] [E:\hejinxu\workspaces-gs-project\workspace_wuxingqu2021\emis\gemp-web\gemp-monitor\node_modules\terser\dist\bundle.min.js:~1] [pc=0000008D902B8F86](this=0x038a015825a9 <AST_ObjectKeyVal map
 = 00000233B7F76451>,t=0x01a0d4c444b1 <Object map = 0000035A92E11929>,n=0x025dc30026f1 <undefined>)
    2: arguments adaptor f...

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
\  Building for production... 1: 00007FF7D427C6AA v8::internal::GCIdleTimeHandler::GCIdleTimeHandler+4506
 2: 00007FF7D4257416 node::MakeCallback+4534
 3: 00007FF7D4257D90 node_module_register+2032
 4: 00007FF7D457189E v8::internal::FatalProcessOutOfMemory+846
 5: 00007FF7D45717CF v8::internal::FatalProcessOutOfMemory+639
 6: 00007FF7D4757F94 v8::internal::Heap::MaxHeapGrowingFactor+9620
 7: 00007FF7D474EF76 v8::internal::ScavengeJob::operator=+24550
 8: 00007FF7D474D5CC v8::internal::ScavengeJob::operator=+17980
 9: 00007FF7D4756317 v8::internal::Heap::MaxHeapGrowingFactor+2327
10: 00007FF7D4756396 v8::internal::Heap::MaxHeapGrowingFactor+2454
11: 00007FF7D4880637 v8::internal::Factory::NewFillerObject+55
12: 00007FF7D48FD826 v8::internal::operator<<+73494
13: 0000008D8FB5C5C1
\  Building for production...^C终止批处理操作吗(Y/N)? y

解决办法:

1、打开cmd,运行 npm install -g increase-memory-limit

npm install -g increase-memory-limit

2、运行increase-memory-limit

increase-memory-limit 

3、重新运行打包命令即可。

参考:https://blog.csdn.net/xiaoxia188/article/details/107833654

  • 2
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值