Skip to content Skip to sidebar Skip to footer

Ineffective Mark-compacts Near Heap Limit Allocation Failed - Windows Angular

My Angular application in Windows10, throwing getting error when using ng build --prod. This is working for ng build. My project using 4 json files in assets folder. One file size

Solution 1:

I fixed this by running below command in Visual Studio Code terminal.

 node --max_old_space_size=8192 ./node_modules/@angular/cli/bin/ng build --prod

In the place of ng build --prod I have used above command.

Script tag in package.json

"scripts": {
    "ng": "ng",   
    "build-prod": "node --max_old_space_size=5048 ./node_modules/@angular/cli/bin/ng build --prod",
    "build:": "node --max_old_space_size=8192 ./node_modules/@angular/cli/bin/ng build",
    "start": "ng serve", 
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },

Post a Comment for "Ineffective Mark-compacts Near Heap Limit Allocation Failed - Windows Angular"