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:

- Step by step instructions to install NodeJS on Windows
- Node.js on Windows 7 under Cygwin, "FixImage error 13" problem
- cyg-apt

Installing cygwin.com

- Goto http://www.cygwin.com/ and download setup.exe
- Run setup.exe as an administrator















-  Filter on python and install all from the python section



- Filter on make and install all from the devel section


- Filter on G++ and install all from the devel section


- Filter on wget and install all from the devel section


Update file rebaseall (Not need for XP)
- With an editor open the file "C:\cygwin\bin/bin/rebaseall"
- Goto line 83 and comment line TmpDir="${TMP:-${TEMP:-/tmp}}"
- Add this line: TmpDir="/tmp"


- Goto line 110 and add this extra filter
-e '/\/sys-root\/mingw\/bin/d'



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

     wget http://nodejs.org/dist/node-v0.2.0.tar.gz
     tar xvf node-v0.2.0.tar.gz
     cd node-v0.2.0/
     ./configure
     make
     make install

- To check that node js has been built enter
      C:\>node --version

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.

I find this post Getting Started with Node.js on Windows from Matthew Podwysocki,
which had the solution.

with the notepad create the file C:\cygwin\etc\resolv.conf and paste the following:

nameserver 8.8.8.8
nameserver 8.8.4.4

22 comments:

  1. Very nice post here and thanks for it .I always like and such a super contents of these post.Excellent and very cool idea and great content of different kinds of the valuable information's.
    Best Devops Training in pune
    Microsoft azure training in Bangalore
    Power bi training in Chennai

    ReplyDelete

  2. It seems you are so busy in last month. The detail you shared about your work and it is really impressive that's why i am waiting for your post because i get the new ideas over here and you really write so well.

    Selenium training in Chennai

    ReplyDelete
  3. Really very happy to say, your post is very interesting to read. I never stop myself to say something about it. You’re doing a great job. Keep it up…

    Became an Expert In Google Cloud Platform Training in Bangalore! Learn from experienced Trainers and get the knowledge to crack a coding interview, @Softgen Infotech Located in BTM Layout.

    ReplyDelete
  4. Post is very useful. Thank you, this useful information.

    Start your journey with In Software Training in Bangalore and get hands-on Experience with 100% Placement assistance from experts Trainers @eTechno Soft Solutions Located in BTM Layout Bangalore.

    ReplyDelete
  5. Your good knowledge and kindness in playing with all the pieces were very useful. I don’t know what I would have done if I had not encountered such a step like this.

    Big Data Hadoop Training In Chennai | Big Data Hadoop Training In anna nagar | Big Data Hadoop Training In omr | Big Data Hadoop Training In porur | Big Data Hadoop Training In tambaram | Big Data Hadoop Training In velachery


    ReplyDelete
  6. I am so proud of you and your efforts and work make me realize that anything can be done with patience and sincerity. Well I am here to say that your work has inspired me without a doubt.
    python training in chennai

    python online training in chennai

    python training in bangalore

    python training in hyderabad

    python online training

    python flask training

    python flask online training

    python training in coimbatore




    ReplyDelete
  7. It was really nice blog with lot of innovative thing inside this, I really enjoyable i would like to thank for sharing this valuable content. I was so glad to see this wonderful blog. keep updating this type of blog. amazon web services aws training in chennai

    microsoft azure training in chennai

    workday training in chennai

    android-training-in chennai

    ios training in chennai

    ReplyDelete
  8. Generally excellent review. I absolutely love this site. Much appreciated! best interiors

    ReplyDelete

  9. This post is so interactive and informative.keep update more information...
    RPA Training in Velachery
    RPA Training in Chennai

    ReplyDelete
  10. This post is so usefull and informative.keep updating with more information...
    Testing Benefits
    Software Testing

    ReplyDelete
  11. This post is so interactive and informative.keep update more information...
    Importance of Software Testing Tool
    Software Testing Tool

    ReplyDelete
  12. This post is so interactive and informative.keep update more information…
    German Classes in Anna Nagar
    German Classes in chennai



    ReplyDelete
  13. This comment has been removed by the author.

    ReplyDelete