My Software Notes

Useful things I discover

Archive for September 2011

Installing nodejs and iisnode on Windows

with 7 comments

The instructions I used are at WebMatrix and node.js: The easiest way to get started with node on Windows

Here’s how it went for me:

  1. WebMatrix Install:  It took a looooong time to install, about 30 minutes.  I was running quite a few things on my machine at the time, including VS2010 and SQL Mgmt Studio, but it still seemed like a heckuva long time, so be patient.
  2. node.js for Windows Install:  If you save to the default downloads folder in IE9 you’ll get the “This program is not commonly downloaded and could harm your computer” message.  Click on “Actions” > “More actions” and “Run anyway”. Or you can open the folder in Windows explorer and double-click the file.  Once you get that far the rest is easy.  It installs to “C:\Program Files\nodejs”  Add it to your path so you can play with the REPL and can run .js scripts.  Once it’s in your path, just type “node” at the command prompt and there you have a JavaScript REPL!  Or type “node myfile.js” and run JavaScript directly on Windows.  Nice!
  3. iisnode for iis7 express (x86) Install: If you don’t have Microsoft Visual C++ 2010 Redistributable Package (x86) installed then the iisnode installer will tell you that you need it. Just click my link here and get it. It installs easily and then the iisnode install is a piece of cake. (FYI: You’ll have the same “This program is not commonly … etc.” message if you try to run after downloading in IE9 and that’ll happen on the next two also.)
  4. iisnode for iis7 (x86) Install: For my messing about I didn’t really need to install it but I wanted to anyway. There were no issues.
  5. iisnode for iis7 (x64) Install: I didn’t install this, ’cause I’m using a 32 bit machine for this messing about, but if you are installing the x64 version then I’m guessing you’ll need the C++ 2010 redistributable for x64.
  6. node.js templates for WebMatrix: Easy install.  Thanks to Steve Sanderson (the genius behind knockout.js) for the templates

So that’s all it took.  After that I fired up WebMatrix and created a “Hello World” type app, by using the “Node.js Express Site” template.  Then I plowed around in the packages that come with it: express and jade, etc.  It’s just amazing what you can get open source these days.  There is a fabulous community out there in JavaScriptland.

Finally I wrote a quick testme.js file and ran it from the command line.  You can use straight JavaScript and all the “console” object methods you get in a browser.  When you want to test out node’s built-in objects and cool async methods, you’ll need to check out the node.js documentation and maybe the node.js wiki.

If I get some time free and I feel courageous, I might try to figure out how to use VS2010 to write node apps.  If anyone out there has already done it then please leave a comment – no point in re-inventing the wheel.

Happy hunting!

Written by gsdwriter

September 29, 2011 at 8:36 am

Nodejs for Windows and IIS

with 2 comments

I’ve been programming a lot of JavaScript recently. I’m really enjoying it as a language. It’s spoiling me for the static languages like C#. (But only a little, after all C# 4 has plenty of dynamic features. In fact, if you use the ExpandoObject you can – to some degree – almost write C# like JavaScript).

Anyway, in expanding my JavaScript horizons I’ve started to dabble with node.js, a server-side implementation of JavaScript.  I’ve been using it mainly for the REPL so I can try out stuff to make sure I’m doing it right.

I installed node.js a month or so ago and it wasn’t too much trouble, but I had to install Cygwin and other stuff with it for it to work on Windows.  I wasn’t interested in taking the time to compile it myself, so I used what the node.js guys were good enough to supply.

I wasn’t looking forward to upgrading though, but Tomasz Janczuk came to my rescue!  He’s been working on making node.js work on not just Windows but also in IIS AND IIS Express.  All the links you need to download node.js are here: Current installation packages for node.js and iisnode for Windows.

Instructions on how to get started using it are here:

The ability to use JavaScript on both the client and the server has tremendous potential for making our lives simpler.  Imagine programming both areas using a single language.  It seems like it’s a ways in the future, but who knows in this industry?

Written by gsdwriter

September 27, 2011 at 2:32 pm