Last active
November 29, 2015 08:38
-
-
Save HashNuke/3961b4f780d068032411 to your computer and use it in GitHub Desktop.
Revisions
-
HashNuke revised this gist
Nov 29, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,7 +4,7 @@ node-gyp needs more ram or swap space to install. Use these commands to create s > Assumes you have Ubuntu. Should work for most Debian-based OSes. These are quick copy-paste commands to create 2gb swap space. Look at the end for info. ``` # feel free to change below values -
HashNuke revised this gist
Nov 29, 2015 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,8 @@ ## node-gyp on small servers node-gyp needs more ram or swap space to install. Use these commands to create swap space as root. (if using sudo, then put the following in a file and then run it using sudo). > Assumes you have Ubuntu. Should work for most Debian-based OSes. These are quick copy-paste commands. Look at the end for info. -
HashNuke created this gist
Nov 29, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,35 @@ ## node-gyp on small servers node-gyp needs more ram or swap space to install. Use these commands to create swap space as root. (if using sudo, then put the following in a file and then run it using sudo) These are quick copy-paste commands. Look at the end for info. ``` # feel free to change below values export SWAP_PATH=/swap export SWAP_SIZE=2097K touch $SWAP_PATH chmod 0600 $SWAP_PATH dd if=/dev/zero of=$SWAP_PATH bs=1024 count=$SWAP_SIZE mkswap $SWAP_PATH swapon $SWAP_PATH echo "$SWAP_PATH none swap sw 0 0" >> /etc/fstab echo 10 | tee /proc/sys/vm/swappiness echo "vm.swappiness = 10" | tee -a /etc/sysctl.conf ``` then as a user that uses `npm`, run following: ``` npm config set jobs 1 ``` ### info * `SWAP_PATH` is the path to create the swap * `SWAP_SIZE` is the size of the swap. We set it at around 2gb * swap size in 1kb blocks * 2048mb * 1024kb == 2097152 * which is approximately 2097 thousand ( == 2097k)