Recently I faced a strange issue where I’m not being able to compile my Angular 7.0+ application because of the below error message
I tried to upgrade the nodeJs and Angular version for my app but with no luck. I even tried to increase the RAMs on my development PC and that didn’t solve the issue.
In order to solve this issue, you will need to adjust the default nodeJs used spaces by using the following command:
node --max_old_space_size=8192 node_modules/@angular/cli/bin/ng build --prod --build-optimizer
Below is the original command that I was using and it was giving me the error in concern
ng build --prod --prod-optimizer