1

I am trying to build and distribute my app using ionic deploy in the Ionic Dashboard. Due to the nature of my app, I am using a custom build script:

"scripts": {
    "build": "npm install -g ionic && npm install -g cordova && npx gulp svgSprite && npm install angular-idle-preload --save && node --max_old_space_size=8192 node_modules/.bin/ng build --prod --verbose"
}

Everything builds fine until around 90% mark, where I get the following error:

89% record hash 0ms record hash
90% module assets processing84ms module assets processing
90% chunk assets processingKilled
npm ERR! code ELIFECYCLE
npm ERR! errno 137
npm ERR! app@0.0.0 build: `npm install -g ionic && 
npm install -g cordova && npx gulp svgSprite && npm install angular-idle-preload --save && node --max_old_space_size=8192 node_modules/.bin/ng build --prod --verbose`
npm ERR! Exit status 137
npm ERR! 
npm ERR! Failed at the app@0.0.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2019-03-21T18_17_39_693Z-debug.log

What's weird is that when I remove the --prod flag it builds just fine. Why am I getting this error? is it a memory issue?

Josh O'Connor
  • 4,694
  • 7
  • 54
  • 98

2 Answers2

0

Yes it is a memory issue. you're running out of memory.

For detail visit these links:

https://github.com/coryhouse/react-slingshot/issues/434

https://github.com/npm/npm/issues/4008

https://github.com/nimiq-network/core/issues/295

Muzaffar Mahmood
  • 1,688
  • 2
  • 17
  • 20
0

npm install -g ionic && npm install -g cordova && npx gulp svgSprite && npm install angular-idle-preload --save && export NODE_OPTIONS=--max_old_space_size=8096 && ionic build --optimizejs --cleancss --cleanjs

Josh O'Connor
  • 4,694
  • 7
  • 54
  • 98