Based on the information you provided, that npm is crashing or killing it’s sub-processes during this install but not at the same point each time the most likely cause is that your droplet is running out of available memory to complete the installation process. This is especially likely if you are running a 512MB droplet.
Droplets do not ship with swap configured by default. This means that if the physical memory available to it is used up it will not buffer memory to the disk, instead processes may be killed.
There are two potential solutions for this issue:
1.) Upgrade to a droplet with more RAM. This will provide the best performing solution for this problem as RAM is much faster than swap.
2.) Create a swap file on your droplet. The installation and other process that have to use the swap space will run slower than they would in physical memory but this should prevent the process from being killed.
One of the easiest way of increasing the responsiveness of your server and guarding against out of memory errors in your applications is to add some swap space. In this guide, we will cover how to add a swap file to an Ubuntu 16.04 server. <$>[warning] [label...