Troubleshooting
Creating a 10GB Swapfile on VPS
To resolve out-of-memory issues during resource-intensive operations like yarn install, follow these steps to create and enable a 10GB swapfile:
Create the swapfile:
sudo fallocate -l 10G /swapfile
Set correct permissions:
sudo chmod 600 /swapfile
Set up the swap area:
sudo mkswap /swapfile
Enable the swap:
sudo swapon /swapfile
Make the swap permanent by adding it to /etc/fstab:
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
Verify the swap is active:
sudo swapon --show
After completing these steps, your system should have an additional 10GB of swap space available. This should help prevent out-of-memory errors during resource-intensive operations like building your project. Note: Consider rebooting your VPS to ensure all changes take effect, although the swap should be immediately available after step 4.
Last updated