Heap out of memory in angular4 while ng build --prod

前端 未结 4 1422
时光说笑
时光说笑 2020-12-25 13:39

I am getting an heap out of memory error while ng build --prod ,Is there any work around. its building fine when --aot=false.

Any idea ?

4条回答
  •  我在风中等你
    2020-12-25 14:36

    Here are the steps i have done to fix the issue based on above post and its worked well for me.

    Step-1

    Open package.json

    Add this code under scripts

    "build-prod": "node --max_old_space_size=5048 ./node_modules/@angular/cli/bin/ng build --prod"

    Step-2

    Open terminal and run execute this code "npm run build-prod"

    Hope this helps

提交回复
热议问题