ng build --prod have javaScript heap out of memory error

前端 未结 4 792
孤街浪徒
孤街浪徒 2020-12-21 01:08

I am facing the below issue while using ng build --prod.

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out o

相关标签:
4条回答
  • 2020-12-21 01:47

    Which Typescript version you are using?

    if it is in 2.x.x, update to 2.7.x where they have fixed.

    0 讨论(0)
  • 2020-12-21 01:48

    add maximumWarning and maximumError help me

    "budgets": [ { "type": "initial", "maximumWarning": "5mb", "maximumError": "12mb" }, { "type": "anyComponentStyle", "maximumWarning": "1mb", "maximumError": "10mb" } ],

    0 讨论(0)
  • 2020-12-21 01:55

    I was facing same issue with ionic 3 unit testing.

    npm test

    was getting memory issue in above command then got it fixed with below commands--

    npm install

    node --max_old_space_size=8048 ./node_modules/@angular/cli/bin/ng test

    It worked for me.

    0 讨论(0)
  • 2020-12-21 02:08

    this worked for me:

    npm install increase-memory-limit -g
    

    then

    increase-memory-limit
    

    for more details, you can check AOT build fails due to "JavaScript heap out of memory

    0 讨论(0)
提交回复
热议问题