gpt4 book ai didi

node.js - fatal error : Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory when running a react app

转载 作者:行者123 更新时间:2023-12-03 08:15:00 25 4
gpt4 key购买 nike

fatal error :接近堆限制的标记压缩无效分配失败 - JavaScript 堆内存不足

我使用的是 npm 版本 8.1.1 和 Node 版本 17.0.1。然后我尝试将 npm 降级到版本 7.24.2,将 Node 降级到 14.18.1 LTS,但仍然遇到相同的错误。


[7432:000001F15002D0F0] 193144 ms: Mark-sweep (reduce) 2037.2 (2051.1) -> 2036.8 (2052.4) MB, 3731.7 / 0.1 ms (average mu = 0.141, current mu = 0.017) allocation failure scavenge might not succeed
[7432:000001F15002D0F0] 196878 ms: Mark-sweep (reduce) 2038.0 (2054.4) -> 2037.6 (2055.1) MB, 3724.3 / 0.1 ms (average mu = 0.080, current mu = 0.003) allocation failure scavenge might not succeed


<--- JS stacktrace --->

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
1: 00007FF684FE412F napi_wrap+133311
2: 00007FF684F7DD06 SSL_get_quiet_shutdown+63062
3: 00007FF684F7EB9D node::OnFatalError+301
4: 00007FF6858619CE v8::Isolate::ReportExternalAllocationLimitReached+94
5: 00007FF6858467BD v8::SharedArrayBuffer::Externalize+781
6: 00007FF6856EFFCC v8::internal::Heap::EphemeronKeyWriteBarrierFromCode+1516
7: 00007FF6856FB3EA v8::internal::Heap::ProtectUnprotectedMemoryChunks+1258
8: 00007FF6856F8529 v8::internal::Heap::PageFlagsAreConsistent+2457
9: 00007FF6856ED0C1 v8::internal::Heap::CollectGarbage+2049
10: 00007FF6856EB2C5 v8::internal::Heap::AllocateExternalBackingStore+1349
11: 00007FF68570B73B v8::internal::Factory::NewFillerObject+203
12: 00007FF685439F81 v8::internal::interpreter::JumpTableTargetOffsets::iterator::operator=+1409
13: 00007FF6858ECDFD v8::internal::SetupIsolateDelegate::SetupHeap+474253
14: 00007FF6858EDCAD v8::internal::SetupIsolateDelegate::SetupHeap+478013
15: 00007FF68593DE89 v8::internal::SetupIsolateDelegate::SetupHeap+806169
16: 00007FF6858DC792 v8::internal::SetupIsolateDelegate::SetupHeap+407074
17: 0000031867B4B9AC ```

最佳答案

对我有用的解决方案是在与 package.json 相同的目录中添加 .env 文件并添加 GENERATE_SOURCEMAP=false进入 .env 文件。

请参阅此引用https://create-react-app.dev/docs/advanced-configuration/

关于node.js - fatal error : Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory when running a react app,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69685755/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com