How to install node.js on Debian and CentOS linux

→ Are you a new visitor? Please visit the page guidance for new visitors ←

How to install node.js on Debian and CentOS

What is node.js? From their website, node.js is a platform built on Google Chrome JavaScript runtime for building fast and scalable network application. I did however seen lots of users still thinking they can install this on a shared hosting service, and here I am confirming that this is not possible. You need root access for you to be able run the node application. So unfortunately at least a VPS server will be required in order to install node.js. In this article I’m going to show you how to install node.js on Debian and CentOS linux operating system. This also works on windows also, however I’m not able to test this so I’ll skip it in this article.

Install node.js on Debian

First we need to make sure we have the necessary packages to be able to compile it. I don’t recommend using the repository from sid, this is currently unstable. So let’s get started:

Now from here is the real tricky part, from readme on git it does not say this, but for checkinstall to be able to build the deb files it needs the folder to be in the format packagename-number. Currently the version of node.js isĀ 0.10.19 so we run the commands:

And now we run checkinstall and build the deb files without installing them. This time checkinstall will run without errors:

This will build the deb files necessary for installing node.js. Now you just need to run:

and it will install node.js for you. You can test this by running the command:

Install node.js on CentOS

For Fedora or CentOS operating system, this is a bit simpler, you have a repo you can use directly and install node and npm. Well basically you install npm and it will install node automatically. First we need to install Epel repository so that we can begin the installation, run the commands below:

 

Then we install the rpm using:

And finally we install npm which will install node for us automatically.

The result would be similar as before:

So that’s about it, the only thing I found different from the docs is when using checkinstall to build the deb file. Now you can start building your node.js application and run it on your server.

If you found anything missing please comment below and subscribe. Until next time!

Request an article ←