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)
- Zend Soap NULL Reponse - August 29, 2018
- Quick Facts About WooCommerce - April 25, 2018
- WordPress stuck on a “Too many redirects” error loop when using SSL - January 17, 2018