npm 包错误,<--- JS stacktrace --->致命错误:表大小无效分配失败 - JavaScript 堆内存不足

发布于 2025-01-10 14:35:50 字数 2451 浏览 0 评论 0 原文

#运行其他reactjs项目可以工作,但是运行其他一些项目会遇到这个错误,增加内存并不能解决问题,清除缓存也不能修复节点,我是stack#

Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
Starting the development server...


<--- Last few GCs --->

[24628:0000025F59DB78F0]    10935 ms: Scavenge 318.7 (375.5) -> 318.7 (375.5) MB, 37.4 / 0.0 ms  (average mu = 0.990, current mu = 0.984) allocation failure 
[24628:0000025F59DB78F0]    13187 ms: Scavenge 510.7 (567.5) -> 510.7 (567.5) MB, 165.5 / 0.0 ms  (average mu = 0.990, current mu = 0.984) allocation failure 
[24628:0000025F59DB78F0]    18581 ms: Scavenge 894.7 (951.6) -> 894.7 (951.6) MB, 315.3 / 0.0 ms  (average mu = 0.990, current mu = 0.984) allocation failure 


<--- JS stacktrace --->

FATAL ERROR: invalid table size Allocation failed - JavaScript heap out of memory
 1: 00007FF635DA7B7F v8::internal::CodeObjectRegistry::~CodeObjectRegistry+114079
 2: 00007FF635D34546 DSA_meth_get_flags+65542
 3: 00007FF635D353FD node::OnFatalError+301
 4: 00007FF63666B29E v8::Isolate::ReportExternalAllocationLimitReached+94
 5: 00007FF63665587D v8::SharedArrayBuffer::Externalize+781
 6: 00007FF6364F8C4C v8::internal::Heap::EphemeronKeyWriteBarrierFromCode+1468
 7: 00007FF635FC8D89 v8::internal::Isolate::FatalProcessOutOfHeapMemory+25
 8: 00007FF63632D115 v8::internal::HashTable<v8::internal::NumberDictionary,v8::internal::NumberDictionaryShape>::EnsureCapacity<v8::internal::Isolate>+341
 9: 00007FF63632AE66 v8::internal::Dictionary<v8::internal::NumberDictionary,v8::internal::NumberDictionaryShape>::Add<v8::internal::Isolate>+86
10: 00007FF6363C8595 v8::internal::FeedbackNexus::ic_state+32581
11: 00007FF6363C29F2 v8::internal::FeedbackNexus::ic_state+9122
12: 00007FF636375714 v8::internal::JSObject::AddDataElement+1092
13: 00007FF63633442B v8::internal::StringSet::Add+1835
14: 00007FF63637700C v8::internal::JSObject::DefineAccessor+1644
15: 00007FF6363764AB v8::internal::JSObject::AddProperty+3083
16: 00007FF63637667B v8::internal::JSObject::AddProperty+3547
17: 00007FF636240658 v8::internal::Runtime::GetObjectProperty+5064
18: 00007FF6366F8F91 v8::internal::SetupIsolateDelegate::SetupHeap+494417
19: 00007FF636722E5D v8::internal::SetupIsolateDelegate::SetupHeap+666141
20: 00007FF63670CD2A v8::internal::SetupIsolateDelegate::SetupHeap+575722
21: 00007FF63668B53E v8::internal::SetupIsolateDelegate::SetupHeap+45310
22: 0000025F5C052EC8

#running other reactjs projects work but running some others run into this error, increasing memory is not solving the issue and clearing cache is also not healing the node,I am stack#

Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
Starting the development server...


<--- Last few GCs --->

[24628:0000025F59DB78F0]    10935 ms: Scavenge 318.7 (375.5) -> 318.7 (375.5) MB, 37.4 / 0.0 ms  (average mu = 0.990, current mu = 0.984) allocation failure 
[24628:0000025F59DB78F0]    13187 ms: Scavenge 510.7 (567.5) -> 510.7 (567.5) MB, 165.5 / 0.0 ms  (average mu = 0.990, current mu = 0.984) allocation failure 
[24628:0000025F59DB78F0]    18581 ms: Scavenge 894.7 (951.6) -> 894.7 (951.6) MB, 315.3 / 0.0 ms  (average mu = 0.990, current mu = 0.984) allocation failure 


<--- JS stacktrace --->

FATAL ERROR: invalid table size Allocation failed - JavaScript heap out of memory
 1: 00007FF635DA7B7F v8::internal::CodeObjectRegistry::~CodeObjectRegistry+114079
 2: 00007FF635D34546 DSA_meth_get_flags+65542
 3: 00007FF635D353FD node::OnFatalError+301
 4: 00007FF63666B29E v8::Isolate::ReportExternalAllocationLimitReached+94
 5: 00007FF63665587D v8::SharedArrayBuffer::Externalize+781
 6: 00007FF6364F8C4C v8::internal::Heap::EphemeronKeyWriteBarrierFromCode+1468
 7: 00007FF635FC8D89 v8::internal::Isolate::FatalProcessOutOfHeapMemory+25
 8: 00007FF63632D115 v8::internal::HashTable<v8::internal::NumberDictionary,v8::internal::NumberDictionaryShape>::EnsureCapacity<v8::internal::Isolate>+341
 9: 00007FF63632AE66 v8::internal::Dictionary<v8::internal::NumberDictionary,v8::internal::NumberDictionaryShape>::Add<v8::internal::Isolate>+86
10: 00007FF6363C8595 v8::internal::FeedbackNexus::ic_state+32581
11: 00007FF6363C29F2 v8::internal::FeedbackNexus::ic_state+9122
12: 00007FF636375714 v8::internal::JSObject::AddDataElement+1092
13: 00007FF63633442B v8::internal::StringSet::Add+1835
14: 00007FF63637700C v8::internal::JSObject::DefineAccessor+1644
15: 00007FF6363764AB v8::internal::JSObject::AddProperty+3083
16: 00007FF63637667B v8::internal::JSObject::AddProperty+3547
17: 00007FF636240658 v8::internal::Runtime::GetObjectProperty+5064
18: 00007FF6366F8F91 v8::internal::SetupIsolateDelegate::SetupHeap+494417
19: 00007FF636722E5D v8::internal::SetupIsolateDelegate::SetupHeap+666141
20: 00007FF63670CD2A v8::internal::SetupIsolateDelegate::SetupHeap+575722
21: 00007FF63668B53E v8::internal::SetupIsolateDelegate::SetupHeap+45310
22: 0000025F5C052EC8

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

庆幸我还是我 2025-01-17 14:35:50

这看起来像是 nodejs 安装损坏

卸载并重新安装您的nodejs。

清理您的node_modules并重新安装所有依赖项。

再次运行并告诉我们是否能解决任何问题。

This looks like a corrupted installation of nodejs.

Uninstall and reinstall your nodejs.

Clean your node_modules and reinstall all your dependencies.

Run again and tell us if that solve anything.

那请放手 2025-01-17 14:35:50

我遇到了同样的问题,但就我而言,当我尝试在 Angular 上执行 npm 测试时,我遇到了同样的错误。解决方案是:

  1. 在项目上重新安装 node_modules
  2. npm install

这解决了我的问题

I had the same problem, but in my case when i try to execute a npm test on angular, i had the same error. The solution was:

  1. reinstall node_modules on your project
  2. npm install

This solve my problem

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文