Third article in our series (check the first one, the second one), now let’s install NodeJS (0.10, 0.12, 4 or 5) and PM2 on our server.
Choose version of NodeJS you would like to install. I use v4 for now.
sudo curl -sL https://rpm.nodesource.com/setup_5.x | bash -
sudo curl -sL https://rpm.nodesource.com/setup_4.x | bash -
sudo curl -sL https://rpm.nodesource.com/setup_0.12 | bash -
sudo curl -sL https://rpm.nodesource.com/setup | bash -
Then install it
sudo yum install -y nodejs
NPM was installed by default. We will need devtools to compile and install some native addons from npm.
sudo yum groupinstall 'Development Tools'
sudo npm install pm2 -g
sudo pm2 startup centos
That’s it! We’ve got Node v4, NPM and PM2 on Centos 7.