#!/bin/bash
#....
# Make sure only root can run our script
if [ "$(id -u)" != "0" ]; then
echo "This script must be run as root" 1>&2
exit 1
fi
curl --silent --location https://rpm.nodesource.com/setup_6.x | bash -
yum -y install nodejs
yum -y groupinstall 'Development Tools'
yum -y install git
# ... install pm2
echo "installing pm2 using npm"
npm install -g pm2
npm install -g n