Getting Started With Node.js

Friday, September 2, 2011

 

Recently I’ve been playing around with Node.js, the new hotness that is event-based server side JavaScript. It’s been a bit challenging figuring out how to get it going on Windows since Windows support has only just recently been added. So here’s what I did to get all set up writing Node.js apps on Windows. This is more of a brain dump than anything because I have a tendency to get enamored with the new shiny thing and then ignore it for months until I come back to it having forgot all the details on the environment I had set up.

1 – Download the latest Node.js Windows executable from the most recent post on the Node.js blog. I put mine in c:\node

2 – Download and install Python 2.7.2 It has to be 2.x, this is a prerequisite for the next step.

3 – Download ryppi.py from it’s github repository and shove it in the same directory where you put node.exe. This is a python script that emulates npm, the node package manager, which does NOT support Windows, even under cygwin.

4 – Use ryppi.py in place of npm. In blog posts, where you see npm install <packagename>, execute ryppi.py install <packagename> in a command prompt where your node.exe is.

5 – Save the hello world web server sample as helloworld.js in your node directory and run node.exe helloworld.js from a command line.

I should mention that prior to doing all this I tried building node from source and executing it under cygwin which is detailed over on github. This is painful and error prone and I would recommend avoiding unless you really want to for some reason.

Helpful / Interesting link dump:

- Nodester.com is a node.js cloud hosting. Literally run a few command line utilities and your node app is running on a subdomain on nodester.com. I haven’t tried it out yet but it looks impressive.

- Nodecasts.org is a site for screencasts about node. Only two so far though.

- Expressjs.com seems to be the dominant web framework for node.js.

- Express-Resource is a module for express I’ve been playing around with that adds simplified RESTful routing over express.

0 comments:

Post a Comment

top