Desk2Mob

Desk2Mob

Desk2Mob

How to install node.js on Windows 7

  • Open http://nodejs.org/, after that click on Download (http://nodejs.org/download/), so you can see the following details on the screen
    Select Window msi for node.js

  • Now base on your window 7 system type (means if it is 32 bit or 64 bit) download appropriate Windows Installer. If you don't know How to determine if you are using 32-bit or 64-bit windows, please Click Here.

  • Open Command Prompt with administrator privileges, please see following image for more information. A right click on Command Prompt and click on Run as administrator.
    Open Command Prompt

  • Now run following command

    msiexec /i node-v0.10.26-x64.msi

Run Installation Command on Console

  • After hitting enter key, you will the Welcome Setup Wizard screen,

Welcome Image

  • Now click on “Next” button,

Accept License

  • Accept the license agreement and click Next.

Choose Destination Folder

  • Leave the Destination Folder as the default (C:\Program Files\nodejs) and click Next button to Continue:

Default Installation

  • On “Select the way you want features to be installed.” screen just click the Next button to continue.

Click on Install

  • Now Click on Install button, so installation procedure start as next image,

Installation Going on Please wait

  • After the installation has finished you will see the Installation Wizard Completed window, click Finish button:

Click on Finish

  • Now we need to test whether we installed nodejs properly or not. So open the command prompt

Open Command Prompt

  • and type following command and press enter.

    npm ls -g

Validate node.js

  • You should see that you have an empty list, no modules installed globally, as per below image

nodejs_installation_confirmation

Now you are done.

  • Let's also validate with sample application using

Using Web server

  • I copied following code from nodejs.org site and save with example.js

    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/');

  • Now execute this program from the command line,

Running Web Program

Opening Browser

TCP server

Posted on April 29, 2014 by Amit Pandya in node.js


All Posts