Download nodejs tar.gz from nodejs
$ unzip nodejs tar.gz
$ ./configure
$ sudo make install
That's it! You can do a little test to make sure that nodejs has been installed correctly
$ node -v
Now, we can add a simple server side source code named server.js like this
var http = require('http');
var server = http.createServer(function(req, res) {
res.writeHead(200);
res.end('Hello Http');
});
server.listen(8080);
and start up this simple server bynode server.js
opening a browser and navigating to http://localhost:8080
Here is a good beginners guide