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
- 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.
- 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.
- 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.
- Inside the above etc folder create a file resolv.conf.
- 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.
- Launch cmd (Windows Command).
- Type cd C:\node\bin (if node is folder where you extracted the node binaries).
- Type shell.
- Now run your npm as – node npm install <package name> (without the angle brackets of course).
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)
Having run shell.cmd, and within the “C:\node\bin” directory mentioned in the instructions, obviously.
Sorry I can’t help you with this. I suggested asking this in npm group (http://groups.google.com/group/npm-).
Thanks for this post, as I’m trying to learn Node.js on my Windows laptop.
Worked like a charm for me. Windoze Vista. Make sure to run shell.exe from the cmd prompt, not bash.
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)
Make sure that you have restarted the system after env variable update. Sometimes it doesn’t take effect without restart.
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.