Angular 2 Aot Error: FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory

前端 未结 2 1835
忘了有多久
忘了有多久 2021-01-21 06:07

While Running Angular 2 AOT rollup I have faced above issue

<--- Last few GCs --->

  144518 ms: Mark-sweep 1317.0 (1404.4) -> 1317.0 (1404.4) MB, 1522         


        
相关标签:
2条回答
  • 2021-01-21 07:03

    Tried almost all the options but no luck,

    JUST increased Virtual memory and it worked :-)

    Permanent fix(Commands are for Windows :

    For Compilation:

    node --max-old-space-size=8192 node_modules/@angular/compiler-cli/src/main.js -p tsconfig-aot.json
    

    For Rollup:

    node --max-old-space-size=8192 node_modules/rollup/bin/rollup -c rollup-config.js
    
    0 讨论(0)
  • 2021-01-21 07:07

    Add = between the option and its value :

    node --max_old_space_size=4096   
    

    NOT

    node --max_old_space_size 4096 
    
    0 讨论(0)
提交回复
热议问题