Question

NPM gets killed no matter what.

  • Posted October 29, 2014

I have a droplet with Ubuntu 12.04 where i have installed node and npm. But no matter what i try, npm works a little and the gets “killed”. It happens if i try “npm update” or “npm install”.

Anyone know what causes this and if there is a solution?

Subscribe
Share

Cheapest solution is to create a swap file, it only takes 5 minutes and you don’t need to pay anything extra. https://www.digitalocean.com/community/tutorials/how-to-add-swap-on-ubuntu-14-04

If you however need speed, you should increase the droplet.

Cheapest solution is to create a swap file, it only takes 5 minutes and you don’t need to pay anything extra. https://www.digitalocean.com/community/tutorials/how-to-add-swap-on-ubuntu-14-04

If you however need speed, you should increase the droplet.

Cheapest solution is to create a swap file, it only takes 5 minutes and you don’t need to pay anything extra. https://www.digitalocean.com/community/tutorials/how-to-add-swap-on-ubuntu-14-04

If you however need speed, you should increase the droplet.

Cheapest solution is to create a swap file, it only takes 5 minutes and you don’t need to pay anything extra. https://www.digitalocean.com/community/tutorials/how-to-add-swap-on-ubuntu-14-04

If you however need speed, you should increase the droplet.

Cheapest solution is to create a swap file, it only takes 5 minutes and you don’t need to pay anything extra. https://www.digitalocean.com/community/tutorials/how-to-add-swap-on-ubuntu-14-04

If you however need speed, you should increase the droplet.

Cheapest solution is to create a swap file, it only takes 5 minutes and you don’t need to pay anything extra. https://www.digitalocean.com/community/tutorials/how-to-add-swap-on-ubuntu-14-04

If you however need speed, you should increase the droplet.

Cheapest solution is to create a swap file, it only takes 5 minutes and you don’t need to pay anything extra. https://www.digitalocean.com/community/tutorials/how-to-add-swap-on-ubuntu-14-04

If you however need speed, you should increase the droplet.

Cheapest solution is to create a swap file, it only takes 5 minutes and you don’t need to pay anything extra. https://www.digitalocean.com/community/tutorials/how-to-add-swap-on-ubuntu-14-04

If you however need speed, you should increase the droplet.

Cheapest solution is to create a swap file, it only takes 5 minutes and you don’t need to pay anything extra. https://www.digitalocean.com/community/tutorials/how-to-add-swap-on-ubuntu-14-04

If you however need speed, you should increase the droplet.

Cheapest solution is to create a swap file, it only takes 5 minutes and you don’t need to pay anything extra. https://www.digitalocean.com/community/tutorials/how-to-add-swap-on-ubuntu-14-04

If you however need speed, you should increase the droplet.


Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

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

This will create a swap file of 1GB

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

This will create a swap file of 1GB

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

This will create a swap file of 1GB

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

This will create a swap file of 1GB

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

This will create a swap file of 1GB

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

This will create a swap file of 1GB

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

This will create a swap file of 1GB

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

This will create a swap file of 1GB

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

This will create a swap file of 1GB

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

This will create a swap file of 1GB