Installing nodeJs in Windows (The easiest way)

The immensely exciting nodejs is not really made to run on Windows, but like me, if you want to develop on a Windows system then you will need to install it on Windows.

Installing nodeJs on Windows

  1. Get the Windows binary from http://node-js.prcn.co.cc/. Download the complete package. The current version is 0.4.4. You can download it from http://node-js.prcn.co.cc/bin/0.4.4/node-0.4.4-i686-pc-cygwin-complete.7z.
  2. Create a directory (preferably with no spaces in its full path) and extract the contents of above 7z file into that. (You will need free 7zip to extract it.) Let this directory be C:\node.
  3. Create folder etc in the above folder, i.e. inside C:\node. So etc folder will be in the same folder as bin, lib etc folders.
  4. Inside the above etc folder create a file resolv.conf.
  5. Inside the above file paste the following:-
    nameserver 8.8.8.8
    nameserver 8.8.4.4

Using npm

npm is the popular package manager for nodejs now. So, to be able to use this is absolutely necessary.

  1. Launch cmd (Windows Command).
  2. Type cd C:\node\bin (if node is folder where you extracted the node binaries).
  3. Type shell.
  4. Now run your npm as – node npm install <package name> (without the angle brackets of course).

 

8 Comments

  1. The npm instructions don’t work on Windows 7 with the node.js 4.7 binaries. The file “npm” seems to have the system attribute set. Removing the attribute (attrib -s *), then running “node npm” fails with:

    /usr/bin/npm:1
    !��.
    ^

    node.js:134
    throw e; // process.nextTick error, or ‘error’ event on first tick
    ^
    SyntaxError: Unexpected token <
    at Module._compile (module.js:399:25)
    at Object..js (module.js:410:10)
    at Module.load (module.js:336:31)
    at Function._load (module.js:297:12)
    at Array. (module.js:423:10)
    at EventEmitter._tickCallback (node.js:126:26)

    Reply

  2. Having run shell.cmd, and within the “C:\node\bin” directory mentioned in the instructions, obviously.

    Reply

  3. Hi, thanks for the post, it works form me when i execute node in its bin directory but it doesnt find the modules if i do it in another one (i have the path to node/bin in my PATH env var)

    Reply

  4. thanks dear, it worked for me. i just put all the extracted data of my zip in a folder c:/node/ and just run the command ->”node npm install node” . Beyond it i do nothing more than it.

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.