Skip to content

Instantly share code, notes, and snippets.

@silvae86
Created November 13, 2017 17:26
Show Gist options
  • Save silvae86/bc2aef529b0cc7da827aee05225c9f26 to your computer and use it in GitHub Desktop.
Save silvae86/bc2aef529b0cc7da827aee05225c9f26 to your computer and use it in GitHub Desktop.
Solving Spawn ENOMEM Error in Ubuntu + NodeJS
#credits https://stackoverflow.com/questions/26193654/node-js-catch-enomem-error-thrown-after-spawn
sudo fallocate -l 4G /swapfile #Create a 4 gigabyte swapfile
sudo chmod 600 /swapfile #Secure the swapfile by restricting access to root
sudo mkswap /swapfile #Mark the file as a swap space
sudo swapon /swapfile #Enable the swap
echo "/swapfile none swap sw 0 0" | sudo tee -a /etc/fstab #Persist swapfile over reboots (thanks for the tip, bman!)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment