Question

NPM gets killed no matter what.

  • Posted on October 29, 2014
  • andeersgAsked by andeersg

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?

Show comments

Submit an answer

This textbox defaults to using Markdown to format your answer.

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

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

I found a solution that seems to work. I upgraded my swap-file to 1gb from 500mb ca.

Then i could install modules again.

I followed these instructions to do it.

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

Created the swap file. Solved all my issues. Was also trying to get started using Keystone.js / node / Express