Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

angular

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 ?

enter image description here

like image 837
Shijith Mohanan Avatar asked Oct 18 '17 09:10

Shijith Mohanan


Video Answer


1 Answers

Try running build script in package json by the following script:

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

Reference

like image 95
Sajeetharan Avatar answered Sep 21 '22 13:09

Sajeetharan