Playing With NodeJs (1) Running on Windows (and Azure)

Up until some weeks ago, the only way to run NodeJs on Windows were to download it from the Git repo and compile it using CygWin (another case of get the bananas AND get the monkey).

Building node.js on Cygwin (Windows)
How to install Node.js on Windows

But now there is an alternative: NodeJs team has published a Windows pre-compiled version (0.5.4 and 0.5.5):

(there is a new version

I’m using the 0.5.4. Let’s run a simple demo that use Socket.IO:

The Socket.IO module is missing. npm is the “standard” package manager for NodeJs, but there is no Windows version yet:

how can i do npm on windows!

So, you can download the module and its dependencies. See:

Node.js on Windows: Who Needs NPM?

Where are the URLs of the dependencies repos? You can look at

I downloaded some modules, this is my current setup:

These are subdirectories of the directory where node.exe resides. The key file to read in each module is its Package.json. This is the manifest of Socket.IO:

    "name": ""  , 
    "version": "0.7.9"  ,
    "description": "Real-time apps made cross-browser & easy with a WebSocket-like API"  ,
    "homepage": ""  , 
    "keywords": ["websocket", "socket", "realtime", "", "comet", "ajax"]  , 
    "author": "Guillermo Rauch <>"  , 
    "contributors": [        
	{ "name": "Guillermo Rauch", "email": "" }      , 
        { "name": "Arnout Kazemier", "email": "" }      ,
        { "name": "Vladimir Dronnikov", "email": "" }
     ]  ,
	    "type": "git"      , 
        "url": ""    
     }  ,
     "dependencies": {
        "": "0.7.9"      ,
        "policyfile": "0.0.4"      , 
        "redis": "0.6.6"    
     }  ,
     "devDependencies": {
        "expresso": "0.7.7"      ,
        "should": "0.0.4"      , 
        "assertvanish": "0.0.3-1"
    }  ,
     "main": "index"  , 
     "engines": { "node": ">= 0.4.0" }

When I had all the modules, I set the NODE_PATH variable and ran the app again:

Triumph of mind over matter! 😉 This was my first way. But the recommended alternative is to put all the modules in a node_modules subdirectory:

In this way, you don’t need the NODE_PATH environment variable. I’m using NODE_PATH because I have my own modules under development in other directories. But if you have a node_modules subdirectory, NodeJs (>0.5 I guess) looks in that subdirectory for modules AND in NODE_PATH. Then I can use NODE_PATH=c:\Git where my AjFabriq module is under development. NodeJs will find Socket.IO in its node_modules subfolder, and my AjFabriq in c:\Git\ajfabriq.

If you have problems with dependencies, read @cibrax post:

Running the “Express” web development framework on Node for Windows

There is a Python clone of npm to install NodeJs packages.

There is a way to run NodeJs from IIS. Check @shanselman post:

Installing and Running node.js applications within IIS on Windows – Are you mad?

An interesting alternative in ASP.NET:

Asynchronous scalable web applications with real-time persistent long-running connections with SignalR

Well, and if you want to run NodeJs on Azure? Oh! I would like to write a post about that topic, but @ntotten have stolen my idea ;-). Read:

NodeJS on Windows Azure

Other posts about NodeJs and Azure:

Node.js, Ruby, and Python in Windows Azure: A Look at What’s Possible | MIX11 | Channel 9

Node.js, Ruby, and Python in Windows Azure: MIX Talk

Related posts about NodeJs:

Node.Js: Links, news, Resources (2)

Node.Js: Links, news, Resources (1)

Playing with Node.js, Ubuntu, Sqlite3 and node-Sqlite

My links:

More playing with NodeJs is coming.

Keep tuned!

Angel “Java” Lopez

8 thoughts on “Playing With NodeJs (1) Running on Windows (and Azure)

  1. Pingback: » Node.JS Quick Setup

  2. Pingback: AjFabriq on NodeJs (Part 2) A local Simple Application « Angel “Java” Lopez on Blog

  3. Pingback: AjFabriq en NodeJs (Parte 2) Una aplicación local simple - Angel "Java" Lopez

  4. Pingback: Pie in the Sky (September 23, 2011) - MSDN Blogs

  5. Eric

    Would you be interested in writing a commissioned article about Node.js on Windows Azure; approx. please contact me if you’re interested.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s