Monday, 7 November 2011

Installing node.js on windows 7 machine

Ive recently been looking for instructions on how to install node.js (the javascript powered web server) on windows, and it received some quite confusing answers involving cygwin, building things from source etc.
And yes it is possible to install node on windows 7, in fact.... Its really really easy actually.

1. download node.exe from (link avaliable from
2. create a sample node app

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

save in a file 'example.js' and place in the same folder as node.exe (anywhere on your system)
open a command prompt in the folder with node.exe and your .js file

run > node example.js
and thats it, now open your browser and goto:

Hello World

how easy was that?

1 comment:

  1. Comments Added to

    [–]FryGuy1013 1 point 2 days ago
    You miss out on npm though doing it this way in my experience.

    [–]insin 4 points 2 days ago*
    Put node.exe in \node\bin\
    Add \node\bin\ to PATH
    git clone --recursive
    node cli.js install npm -gf

    [–]bornemix 1 point 1 day ago
    But no native extensions... :-(