How To Install Node.js on CentOS 7

r00t August 27, 2015

Install Node.js on CentOS 7

In this tutorial we will show you how to install and configuration of Node.js on your CentOS 7 server. For those of you who didn’t know, Node.js is a Javascript platform for programming that enables users to build network applications very quickly. If you are using Javascript on both the front-end and the back-end, it means your development can be much more consistent and be designed within the same system.

This article assumes you have at least basic knowledge of linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple. I will show you through the step by step installation Node.js on CentOS 7 server.

Install Node.js on CentOS 7

Step 1. First of all make sure that all packages are up to date.

Step 2. Install Node from the EPEL Repository.

Install the node.js package, the command is:

Verify the current version of Node.js installed:

Step 3. Install Node.js from source.

Make sure you always get the latest version of NodeJS. At the time of writing this article, the latest NodeJS version is v0.12.7:

Next, let’s configure NodeJS sources by setting the –prefix flag to /usr/local, so that NodeJS will be installed in this location and will be usable to all users on the vps:

Once the configuration of the sources is finished, compile and install NodeJS using the following commands:

Verify your version of Node.js installed:

Step 4. Install Node.js Using the NVM (Node Version Manager).

Another way of installing Node.js that is particularly flexible is through NVM, the Node version manager. This piece of software allows you to install and maintain many different independent versions of Node.js, and their associated Node packages, at the same time:

This will install the nvm script to your user account. To use it, you must first source your .bash_profile:

Now as we have nvm installed, we can install isolated Node.js versions. To find out the versions of Node.js that are available for installation, we need to type:

Install the version you want with the command:

Example:

Configure nvm to use the version of Node.js that you just downloaded, the command is:

To verify the current version of Node.js installed, the command is:

Congratulation’s! You have successfully installed Node.js. Thanks for using this tutorial for installing Node.js in CentOS 7 system. For additional help or useful information, we recommend you to check the official Node.js web site.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get a best deal!

Save

Share on Google+3Share on Facebook0Tweet about this on TwitterShare on Tumblr0Share on StumbleUpon1Share on Reddit1Pin on Pinterest3
The Tags:

Leave a Comment