Npm install - Out of Memory on Cordova install

I have picked up an application written by a colleague, which is built using ionic/cordova.

I’m trying to install cordova as the first step, using npm:

npm install cordova -g

However, it gets to install cordova-create@v1.1.1 and it hangs for quite a long time, while consuming more and more memory. Eventually after several minutes it fails with:

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - process out of memory

I don’t know if this is an npm issue or not. I have tried installing node LTS and the current version, but both suffer from the same issue. Oddly, my colleagues machine it installs fine and his machine it pretty much the same setup.

If anyone can offer any advice, it would be appreciated.

Seems like a problem with your machine. OS? Did you get rid of your complete NodeJS install and tried again?