npm 包错误,<--- JS stacktrace --->致命错误:表大小无效分配失败 - JavaScript 堆内存不足
#运行其他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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这看起来像是 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.
我遇到了同样的问题,但就我而言,当我尝试在 Angular 上执行 npm 测试时,我遇到了同样的错误。解决方案是:
这解决了我的问题
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:
This solve my problem