npm install killed with no error

I own a low end VPS. I use it to for development. A VPS allows be to SSH in from anywhere in the world from any computer in the world and work on my stuff. The problem is, this VPS is a very much on the low end. It costs me a couple dollars a month to run. It's well worth the price, and normally I don't run into many issues.

However, I was recently trying out the Angular 2 quick start tutorial and my npm command

npm install

would just end with the 'killed' message. No other errors or information was provided by npm. Even running npm in verbose mode did not give any further information as to what was going on.

After some research I have found that this is an issue with the amount of memory available on the virtual machine. npm is running out of memory. This usually happens with the

npm search

command rather than the npm install command, but the angular 2 quick start has enough dependencies in it that my VPS runs out of memory. One option would be to increase the swap size on the VPS, but I am unable to do so with my VPS provider.

Another option is to simply upgrade to more RAM. But that would increase the cost of this little holy VPS. There doesn't seem to be much else in terms of a solution. Maybe I can decrease the amount of dependencies in the project.json file.