Saturday, February 5, 2011

Install Node JS On Windows 2008 and Windows XP

Installing Node JS on Windows 2008 and XP, took me some time and a lot of Googling.
Plus, if you are like me: not a Linux and Cygwin guy, that's even more a challenge.
Anyway I was able to make it.

Here is a summary:

Remarks: On Windows XP thing are simpler, I will mention step that can be skipped for Windows XP. Different version of node.js seems to have different problems. So first I will install and compile node-v0.2.0.
At the of the post I will show how to download and compile node-v0.2.6.
At this time 2011/2/5, I have problems building v0.3.x. I decided not to look into it.

This post is based on information I gathered on the following blog posts and my own experiments:

Run rebaseall (Not needed for XP)
- open a command prompt as administrator
- goto C:\cygwin\bin
- run ash.exe
- enter: rebaseall -v
- quit ash anyway you can (click the close icon)

Get the source code of node.js v0.2.0
- Open the Cygwin console
- Run this batch file as administrator C:\cygwin\Cygwin.bat
- type:pwd [enter]
- You should be located in your folder folder /home/ftorres which is on the disk C:\cygwin\home\ftorres
- To download source code and compile Node.js enter the following command

Testing helloWorld.js
- from http://nodejs.org/ download the hello world sample
- save it to a file in the current directory
- run node.exe HelloWorld.js
- Enter the following url in any browser http://127.0.0.1:8124

Get the source code of node.js v0.2.6

- Open the Cygwin console

- Run this batch file as administrator C:\cygwin\Cygwin.bat

- type:pwd [enter]

- You should be located in your folder folder /home/ftorres which is on the disk C:\cygwin\home\ftorres

- To download source code and compile Node.js enter the following command

wget http://nodejs.org/dist/node-v0.2.6.tar.gz

tar xvf node-v0.2.6.tar.gz

cd node-v0.2.6/

./configure --without-ssl

make

make install

- To check that node js has been built enter

C:\>node --version

Issue with DNS

I tried to write a program that was downloading an rss feed and was faced with DNS error.