【问题标题】:Azure Angular Project build is failing with FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memoryAzure Angular Project 构建失败并出现 FATAL ERROR: In Effective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
【发布时间】:2019-10-18 17:49:39
【问题描述】:

Azure Angular 构建失败 -

致命错误:接近堆限制的无效标记压缩分配失败 - JavaScript 堆内存不足

我们尝试了 - npm run build:ssr --max-old-space-size=1024 m,但没有成功。我们确实尝试过设置不同的尺寸。

这是完整的错误:

2019-06-02T04:27:51.2432150Z [command]C:\windows\system32\cmd.exe /D /S /C "C:\npm\prefix\npm.cmd run build:ssr"
2019-06-02T04:31:03.6579570Z FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
2019-06-02T04:31:03.6580213Z  1: 00007FF675FAF04A v8::internal::GCIdleTimeHandler::GCIdleTimeHandler+5114
2019-06-02T04:31:03.6580271Z  2: 00007FF675F8A0C6 node::MakeCallback+4518
2019-06-02T04:31:03.6580376Z  3: 00007FF675F8AA30 node_module_register+2032
2019-06-02T04:31:03.6580421Z  4: 00007FF6762120EE v8::internal::FatalProcessOutOfMemory+846
2019-06-02T04:31:03.6580464Z  5: 00007FF67621201F v8::internal::FatalProcessOutOfMemory+639
2019-06-02T04:31:03.6580573Z  6: 00007FF676732BC4 v8::internal::Heap::MaxHeapGrowingFactor+9556
2019-06-02T04:31:03.6580676Z  7: 00007FF676729C46 v8::internal::ScavengeJob::operator=+24310
2019-06-02T04:31:03.6580721Z  8: 00007FF67672829C v8::internal::ScavengeJob::operator=+17740
2019-06-02T04:31:03.6580764Z  9: 00007FF676730F87 v8::internal::Heap::MaxHeapGrowingFactor+2327
2019-06-02T04:31:03.6580880Z 10: 00007FF676731006 v8::internal::Heap::MaxHeapGrowingFactor+2454
2019-06-02T04:31:03.6580923Z 11: 00007FF6762ECDB7 v8::internal::Factory::NewFillerObject+55
2019-06-02T04:31:03.6580965Z 12: 00007FF676382CC6 v8::internal::WasmJs::Install+29414
2019-06-02T04:31:03.6581005Z 13: 000002DF3095C5C1 
2019-06-02T04:31:03.6581101Z npm ERR! code ELIFECYCLE
2019-06-02T04:31:03.6581140Z npm ERR! errno 134
2019-06-02T04:31:03.6581185Z npm ERR! futek-ui@0.0.0 build:client-and-server-bundles: `ng build --prod && ng run FutekUI:server`
2019-06-02T04:31:03.6581285Z npm ERR! Exit status 134
2019-06-02T04:31:03.6581327Z npm ERR! 
2019-06-02T04:31:03.6581371Z npm ERR! Failed at the futek-ui@0.0.0 build:client-and-server-bundles script.
2019-06-02T04:31:03.6581417Z npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2019-06-02T04:31:03.6581502Z 
2019-06-02T04:31:03.6581545Z npm ERR! A complete log of this run can be found in:
2019-06-02T04:31:03.6582900Z npm ERR!     C:\npm\cache\_logs\2019-06-02T04_31_03_522Z-debug.log
2019-06-02T04:31:03.6582942Z npm ERR! code ELIFECYCLE
2019-06-02T04:31:03.6583053Z npm ERR! errno 134
2019-06-02T04:31:03.6583101Z npm ERR! futek-ui@0.0.0 build:ssr: `npm run build:client-and-server-bundles && npm run webpack:server`
2019-06-02T04:31:03.6583142Z npm ERR! Exit status 134
2019-06-02T04:31:03.6583233Z npm ERR! 
2019-06-02T04:31:03.6583275Z npm ERR! Failed at the futek-ui@0.0.0 build:ssr script.
2019-06-02T04:31:03.6583321Z npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2019-06-02T04:31:03.6583489Z 
2019-06-02T04:31:03.6583584Z npm ERR! A complete log of this run can be found in:
2019-06-02T04:31:03.6583613Z 
2019-06-02T04:31:03.6583938Z npm ERR!     C:\npm\cache\_logs\2019-06-02T04_31_03_584Z-debug.log
2019-06-02T04:31:03.6584033Z > futek-ui@0.0.0 build:ssr D:\a\1\s\FutekUI
2019-06-02T04:31:03.6584078Z > npm run build:client-and-server-bundles && npm run webpack:server
2019-06-02T04:31:03.6584115Z 
2019-06-02T04:31:03.6584140Z

【问题讨论】:

标签: angular build


【解决方案1】:

对我来说,这个错误是通过将以下变量添加到我的 linked variable group(库)来解决的。或者,您可以将其作为单独的 Pipeline variable 添加到构建管道中:

姓名:NODE_OPTIONS
值:--max_old_space_size=16384

构建管道或链接库中定义的所有变量都将导出为环境变量。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-03-31
    • 2021-11-25
    • 2022-10-19
    • 2018-07-31
    • 2020-04-23
    • 1970-01-01
    • 2017-10-15
    相关资源
    最近更新 更多