Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

npm install via Digital Ocean gets killed

I uploaded a repo to my Digit Ocean droplet about a year ago and tried to npm install without luck. I recently decided to give it a go again and try to get this figured out, but again, still getting the "Killed" error when I try to npm install.

I understand a few of the packages are deprecated, but would that completely kill the install process? The same project files work on my local machine (of course it only works locally). I'm not sure if the different versions of Node would be the primary cause.

Local Node -v 6.9.1
Drop Node -v 9.2.0

Any ideas would be highly appreciated!

Screen shot from terminal is attached.

npm install Digital Ocean

like image 797
Keith Avatar asked Jan 02 '23 16:01

Keith


2 Answers

Well, I found the answer I was looking for.

Adding a swap file allowed the npm install process to fully complete.

To solve this issue on 14.04 and 16.04:

sudo fallocate -l 1G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
sudo swapon --show
sudo cp /etc/fstab /etc/fstab.bak
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
sudo sysctl vm.swappiness=10
echo 'vm.swappiness=10' | sudo tee -a /etc/sysctl.conf
sudo sysctl vm.vfs_cache_pressure=50
echo 'vm.vfs_cache_pressure=50' | sudo tee -a /etc/sysctl.conf

Source: https://www.digitalocean.com/community/questions/npm-gets-killed-no-matter-what

like image 153
Keith Avatar answered Jan 05 '23 16:01

Keith


Looking at your console it tells you that some packages are deprecated and need to be updated try doing that.

Run the following:

sudo npm install minimatch graceful-fs babel-preset-env nodemailer

sudo npm cache clean -f

sudo npm install -g n

sudo n stable

and as for the gulp-util read : https://github.com/gulpjs/gulp-util as that package is deprecated

(the response also states your node version is 4.2)

like image 27
Garret Avatar answered Jan 05 '23 14:01

Garret