Skip to Content
Author's profile photo Tobias Hofmann

How to install and run node.js

Node.js allows you to write network applications written in Javascript. More information can be found on node.js homepage. First step to install node.js is to download the software. The download page list several package. Use the one that applies to your platform and architecture.

/wp-content/uploads/2012/10/nodejs1_145693.jpg

Installation

The node.js installation wizard will take care of all the steps to install the software.

/wp-content/uploads/2012/10/nodejs2_145703.jpg

Start of the wizard

/wp-content/uploads/2012/10/nodejs3_145704.jpg

Installation done

The last installation screen includes the step needed to actually execute node.js. Just call node from the command line.

Running NodeJS

/wp-content/uploads/2012/10/nodejs4_145705.jpg

/wp-content/uploads/2012/10/nodejs5_145706.jpg

Testing node.js

To see if node.js is working, copy the web server example from the node.js homepage into the screen:

var http =require('http');
http.createServer(function (req, res) {
  res.writeHead(200, {'Content-Type': 'text/plain'});
  res.end('Hello World\n');
}).listen(1337, '127.0.0.1');
console.log('Server running at http://127.0.0.1:1337/');

/wp-content/uploads/2012/10/nodejs6_145707.jpg

To test the created web server, call the web server running under http://localhost:1337 with a browser.

/wp-content/uploads/2012/10/nodejs7_145708.jpg

Node.js is installed and ready to be used.

Assigned Tags

      Be the first to leave a comment
      You must be Logged on to comment or reply to a post.