Have you been planning on setting up Node.js and related dependencies on your EC2 instance but unable to find a all-in-one guide? If so, you have come to the right place.
For this article i am using Amazon AMI EC2 instance running a Fedora Linux. It is a t2.micro instance and has 2Gs of memory. Also, we will be building the node and npm packages from source instead of using binaries.
You will need to have Super User access to your EC2 instance and the rest is just a simple process.
Install build tools
We need to install tools using yum. Run the following from the user home directory:
sudo yum install gcc-c++ make
sudo yum install openssl-devel
sudo yum install git
We need to add /local/bin to the PATH variable:
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
We will build nodejs after fetching from GitHub. Notice that you can checkout a different version:
git clone git://github.com/nodejs/node
git checkout tags/v5.11.0
Just like Node.js, we will install Npm
git clone git://github.com/npm/npm
git checkout tags/v3.8.6
To make sure everything is working as expected, run the following:
npm --version #should show v3.8.6
node --version #should show v5.11.0
That’s it! I hope this helped.
Latest posts by alexey (see all)
- Fixing a WordPress pagination 404 error - June 1, 2017
- Making Yii 2 Client side validation work - April 22, 2017
- Angular 2 : Sending requests with cache control headers - January 25, 2017