Ionic2 RC3 javascript heap out of memory

since some days, i can’t build or run on android:

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
ngc failed
ionic-app-script task: "build"
Error: Error

npm ERR! Windows_NT 10.0.14393
npm ERR! argv “C:\Program Files\nodejs\node.exe” “C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js” “run” “ionic:build” "–"
npm ERR! node v6.7.0
npm ERR! npm v3.10.3
npm ERR! ionic-app-base@ ionic:build: ionic-app-scripts build
npm ERR! Exit status 1

I dont know why it happen, problems are in my project? So how can i track this problems? when i make a “ionic serve” all work perfectly.

npm -v : 3.10.3
node -v : 6.7.0
cordova -v : 6.4.0


“scripts”: {
“ionic:build”: “ionic-app-scripts build”,
“ionic:serve”: “ionic-app-scripts serve”
“dependencies”: {
"@angular/common": “2.1.1”,
"@angular/compiler": “2.1.1”,
"@angular/compiler-cli": “2.1.1”,
"@angular/core": “2.1.1”,
"@angular/forms": “2.1.1”,
"@angular/http": “2.1.1”,
"@angular/platform-browser": “2.1.1”,
"@angular/platform-browser-dynamic": “2.1.1”,
"@angular/platform-server": “2.1.1”,
"@ionic/storage": “1.1.6”,
“ionic-angular”: “2.0.0-rc.3”,
“ionic-native”: “^2.2.3”,
“ionicons”: “^3.0.0”,
“moment”: “^2.15.1”,
“rxjs”: “5.0.0-beta.12”,
“ts-md5”: “^1.2.0”,
“zone.js”: “0.6.26”
“devDependencies”: {
"@ionic/app-scripts": “0.0.45”,
“typescript”: “2.0.6”


I forgot to update my tsconfig.json after put the “include” Array it work.
If my project keep growing i think i could get this problem again, so how expend node memory for compliation?
I found this node command: --max_old_space_size=, but i dont know where use it in scripts.


Have you got it to work?
I still can’t build with --prod flag.

it work for me on app-scripts 1.3.0

1 Like