Angular 5 npm构建崩溃(重新平衡分配失败 - 处理内存不足)

时间:2018-02-16 03:27:15

标签: node.js angular npm build

我已经构建了一个Angular 5门户网站。

在我的本地mac上运行命令时,它是成功的。

features

然而,当在Linux服务器上运行时,它崩溃并出现错误:

npm run build

服务器的CPU配置:

Cannot get stack trace in GC.
FATAL ERROR: NewSpace::Rebalance Allocation failed - process out of memory
 1: node::Abort() [ng]
 2: 0x121a7ac [ng]
 3: v8::Utils::ReportOOMFailure(char const*, bool) [ng]
 4: v8::internal::V8::FatalProcessOutOfMemory(char const*, bool) [ng]
 5: 0xaea73b [ng]
 6: v8::internal::MarkCompactCollector::Evacuate() [ng]
 7: v8::internal::MarkCompactCollector::CollectGarbage() [ng]
 8: v8::internal::Heap::MarkCompact() [ng]
 9: v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [ng]
10: v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [ng]
11: v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationSpace) [ng]
12: v8::internal::Runtime_AllocateInTargetSpace(int, v8::internal::Object**, v8::internal::Isolate*) [ng]
13: 0x18aab070463d

记忆:

description: CPU
product: Virtual CPU 714389bda930
vendor: Intel Corp.
physical id: 400
bus info: cpu@0
version: pc-i440fx-2.10
slot: CPU 0
size: 2GHz
capacity: 2GHz
width: 64 bits

提前致谢。

记忆的限制是原因还是其他原因?

1 个答案:

答案 0 :(得分:0)

我喜欢这样,它对我有用 转到节点模块文件夹bin,例如:D:... \ node_modules \ .bin
使用notepad ++然后在文件中查找“--max-old-space-size = 10240”替换为“--max-old-space-size = 1024000”(重新替换所有内部文件)
您可以通过打开.bin文件夹中的任何文件找到值--max-old-space-size 例如文件“橡子”

change limit memory