Skip to content

Instantly share code, notes, and snippets.

@DorkNstein
Last active October 6, 2016 15:18
Show Gist options
  • Save DorkNstein/990191868719f2b7c3d0e6d5bb985256 to your computer and use it in GitHub Desktop.
Save DorkNstein/990191868719f2b7c3d0e6d5bb985256 to your computer and use it in GitHub Desktop.
Codes to install npm, node and git in new amazon server instance
sudo -i
curl --silent --location https://rpm.nodesource.com/setup_4.x | bash -
yum install -y nodejs
yum install -y gcc-c++ make (optional)
yum install git
node -v --> 4.4.x
npm -v --> 2.15.x
exit
## if npm install doesn't work
sudo /bin/dd if=/dev/zero of=/var/swap.1 bs=1M count=1024
sudo /sbin/mkswap /var/swap.1
sudo /sbin/swapon /var/swap.1
#################################################
## npm node modules packages are not running or not getting installed
## It might be because of low memory for that amazon ec2 instance (RED-HAT takes 40% memory)
## To get around, create a swap file for memory management
## Remove all node_modules and reinstall again (npm install)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment