Node.js is an open source, lightweight and efficient cross-platform  run time environment for server-side and networking applications. Its written by  JavaScript. We can easily build and fast scalable network applications.

Yum Install:

 Execute curl command, 
 #  curl -sL | bash -

+ rpm -qa 'node|npm' | grep -v nodesource

## Run `yum install -y nodejs` (as root) to install Node.js and npm.
## You may also need development tools to build native addons:
##   `yum install -y gcc-c++ make`

 Install development tool to build node.js
# yum install -y gcc-c++ make

 Now Install node.js,
# yum install -y nodejs

Once installation completed find the location,
# whereis node
node: /usr/bin/node /usr/share/node /usr/share/man/man1/node.1.gz

create a sample file for execute node.js, file name is  test.js

My system IP address is  and will assign port number to execute node.js : 9001

var http = require('http');
http.createServer(function (req, res) {
  res.writeHead(200, {'Content-Type': 'text/plain'});
}).listen(9001, '');
console.log('Server running at');

Run node.js in backend process,
# node  /var/www/html/test.js &

Check node.js nunning port number,
# netstat -anp | grep node

tcp        0      0*                   LISTEN      7997/node
# ps aux | grep node

root      7997  0.0  0.6 658820 12732 pts/1    Sl   15:44   0:00 /usr/bin/node /var/www/html/get.js

Finally check your browser with below url,



See more details:

# man node


How to Install Manually:

Download the tar.gz file from the URL : using wget command
# cd /usr/local/

#  wget

Extract that the node.js file 
# tar -xf node-v0.10.34.tar.gz

Execute file:
/usr/local/node-v0.10.34/bin/node   /var/www/html/get.js

Error :

If you may get an error like below,
[root@local]# node  /var/www/html/test.js &

Server running at

        throw er; // Unhandled 'error' event
    at errnoException (net.js:904:11)
    at Server._listen2 (net.js:1023:19)
    at listen (net.js:1064:10)
    at net.js:1146:9
    at dns.js:72:18
    at process._tickCallback (node.js:419:13)
    at Function.Module.runMain (module.js:499:11)
    at startup (node.js:119:16)
    at node.js:906:3


The node cannot listen to your system IP so need to check IP address,

listen(9001, '');
console.log('Server running at');