I am using Ionic to build for Android and I am always getting this error:
I have this from ionic info
:
Make no mistake, I have browsed the whole internet finding solutions but I am not successful.
I have seen and read the following:
- Ionic CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory while starting new project
- Ionic3 android build command not working - FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
- Ionic3 - FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
I also observed that I have this unique error compared to the others:
Security context: 000001F502E3FA99 <JS Object>
1: createLiteral [..]
2: typeToTypeNodeHelper(aka typeToTypeNodeHelper) [..]
I have been stuck for over 2 days on this and I really need help and guidance on this.
Here is my package.json content:
{
"name": "project",
"version": "0.0.1",
"author": "Ionic Framework",
"homepage": "http://ionicframework.com/",
"private": true,
"scripts": {
"clean": "ionic-app-scripts clean",
"build": "ionic-app-scripts build",
"lint": "ionic-app-scripts lint",
"ionic:build": "ionic-app-scripts build",
"ionic:serve": "ionic-app-scripts serve"
},
"dependencies": {
"@angular/common": "5.2.10",
"@angular/compiler": "5.2.10",
"@angular/compiler-cli": "5.2.10",
"@angular/core": "5.2.10",
"@angular/forms": "5.2.10",
"@angular/http": "5.2.10",
"@angular/platform-browser": "5.2.10",
"@angular/platform-browser-dynamic": "5.2.10",
"@ionic-native/camera": "^4.5.2",
"@ionic-native/core": "4.4.0",
"@ionic-native/file": "^4.7.0",
"@ionic-native/file-chooser": "^4.7.0",
"@ionic-native/file-path": "^4.7.0",
"@ionic-native/geolocation": "^4.7.0",
"@ionic-native/onesignal": "^4.5.2",
"@ionic-native/splash-screen": "4.4.0",
"@ionic-native/status-bar": "4.4.0",
"@ionic-native/twitter-connect": "^4.5.2",
"@ionic/storage": "2.1.3",
"angularfire2": "^5.0.0-rc.6",
"cordova-android": "^7.0.0",
"cordova-browser": "~5.0.3",
"cordova-ios": "4.5.4",
"cordova-plugin-camera": "^2.4.1",
"cordova-plugin-compat": "^1.2.0",
"cordova-plugin-device": "^1.1.7",
"cordova-plugin-file": "^6.0.1",
"cordova-plugin-filechooser": "^1.0.1",
"cordova-plugin-filepath": "^1.3.0",
"cordova-plugin-geolocation": "^4.0.1",
"cordova-plugin-inappbrowser": "^2.0.2",
"cordova-plugin-ionic-webview": "^1.2.0",
"cordova-plugin-splashscreen": "^4.1.0",
"cordova-plugin-statusbar": "^2.4.2",
"cordova-plugin-whitelist": "^1.3.3",
"firebase": "^4.12.1",
"ionic-angular": "3.9.2",
"ionic-plugin-keyboard": "^2.2.1",
"ionicons": "3.0.0",
"jssha": "^1.6.2",
"moment": "^2.20.1",
"onesignal-cordova-plugin": "^2.2.5",
"rxjs": "5.5.2",
"sw-toolbox": "3.6.0",
"twitter-connect-plugin": "git+https://github.com/chroa/twitter-connect-plugin.git",
"zone.js": "0.8.18"
},
"devDependencies": {
"@angular/cli": "^1.7.3",
"@angular-devkit/build-optimizer": "^0.5.7",
"@ionic/app-scripts": "^3.1.8",
"@types/jssha": "0.0.29",
"typescript": "^2.6.2"
},
"description": "An Ionic project",
"cordova": {
"plugins": {
"cordova-plugin-inappbrowser": {},
"cordova-plugin-device": {},
"cordova-plugin-ionic-webview": {},
"cordova-plugin-splashscreen": {},
"ionic-plugin-keyboard": {},
"cordova-plugin-filechooser": {},
"cordova-plugin-camera": {
"CAMERA_USAGE_DESCRIPTION": " ",
"PHOTOLIBRARY_USAGE_DESCRIPTION": " "
},
"twitter-connect-plugin": {
"FABRIC_KEY": "XXXXXXXXXX",
"TWITTER_KEY": "YYYYYYYYY",
"TWITTER_SECRET": "ZZZZZZZZZZZZZZZ"
},
"cordova-plugin-statusbar": {},
"cordova-plugin-filepath": {},
"cordova-plugin-file": {},
"cordova-plugin-geolocation": {}
},
"platforms": [
"ios",
"browser",
"android"
]
},
"main": "index.js",
"license": "ISC"
}
Edit: I updated my npm as suggested by @Suraj Rao, and I have version 6.0.0 as the current version, then i tried building again and i got this new related error