When running npm install -g ionic
I get the following error:
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
Is there a way to globally increase the node.js memory limit?
When running npm install -g ionic
I get the following error:
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
Is there a way to globally increase the node.js memory limit?
You can launch NPM using :
node --max_old_space_size=8000 $(which npm) install -g ionic
As described here, the default is 4000 (4Gb).
I flagged this as a duplicate, but in case anyone happens across it, I posted the modern solution to this problem over at https://stackoverflow.com/a/48895989/4200039:
Run these commands
npm install -g increase-memory-limit
Run from the root location of your project:
increase-memory-limit
Look Here For more details https://www.npmjs.com/package/increase-memory-limit
Try,
node --max-old-space-size=<size>
where size is in megabytes.