Scott Hanselman

WebMatrix and node.js: The easiest way to get started with node on Windows

September 16, 2011 Comment on this post [24] Posted in IIS | nodejs | WebMatrix
Sponsored By

Tomasz Janczuk and Steve Sanderson are having entirely too much fun. I posted just two weeks ago on Installing and Running node.js applications within IIS on Windows - Are you mad? when Tomasz and the team got node.js running rather nicely under IIS. Now they've got a nice little development environment in WebMatrix.

Cats and Dogs, living together, mass hysteria

Then, Steve and Tomasz decide to share clever thing with us. Well, let me just show you. Remember, this is all in-progress goofing around v0.5 stuff at best but the concepts are sound.

node.js inside WebMatrix. You may start freaking out now.

And then:

Node.js Express Site1 - Microsoft WebMatrix (76)

Hit Run:

Node.js Express Site running on Windows

How can you use WebMatrix to develop node.js applications yourself? With these easy steps:

Isn't it lovely when LEGO pieces snap together so nicely?

Enjoy, Dear Reader.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Hosting By
Hosted in an Azure App Service
September 16, 2011 6:33
The incubator effect of Webmatrix has been a result I could not foresee (at least not to this level). This node.js implementation into webmatrix looks more elegant than I want to admit. Also, keep up the frequency Scott, you are killing it lately.
September 16, 2011 7:07
Neat.
September 16, 2011 10:11
Of course the easiest way to install node.js and keep it up to date is via Chocolatey. You can find it at Chocolatey.org.

Chcolatey is based on nuget BTW ;-)
September 16, 2011 15:59
love the ghost busters reference
you're posts lately have been great

thanks for everything!
September 16, 2011 17:56
I love Legos! Now, can Steve and his friends make me a Lego Star Wars Super Star Destroyer with Node, knockout.js, and a herring?
September 16, 2011 18:38
This is post is the best thing that has ever happend to me, I have been so interested in node but did not know how to start.
September 16, 2011 18:46
Perhaps the next big step in WebMatrix love ... using it as a front end to the RailsInstaller.org package? And more than just 'opening a site from folder' ... things like syntax love, acknowledgement of the local web server, open source app integration, and getting a WebMatrix workflow hug around working with a Rails app. Would love to see that happen; heck would love to be a part of making it happen. I just don't know where to start but I know the two would be awesome together.
September 16, 2011 20:16
I've never seriously used WebMatrix so this might have an obvious answer, but is there any hope of using something like Chirpy or Mindtouch's Web Workbench with it? That would allow you to write your node app in Coffeescript, which makes this even more interesting.
September 16, 2011 23:28
What text editor is that?
September 16, 2011 23:34
So it's something called web matrix but I wish there was a Vim for Windows that looked like that. Super nice.
September 16, 2011 23:38
Just a couple of things,

Love your blog!

Respectfully, EvilKiru :-)
September 17, 2011 0:34
Truly mad scientist evil...

I got my existing node.js project running in WebMatrix, but there are a few gotchas I think you should enumerate, in particular with regards to modules and ports.

1. Modules can be downloaded off of github and installed in the node_modules directory of the website. No need for NPM.
2. Socket.io works!
3. Modules have dependencies, which downloading off of github doesn't get you. So don't forget to also download those dependencies. Modules can have their own node_modules subdirectory.
4. WebMatrix sets its own port in IIS Express, so your server/app should reuse that port.

The Express project template was extremely helpful.
September 17, 2011 19:26
While this is certainly cool, I still don't entirely get the point. WebMatrix is an average (at best) IDE and the node hooks only seem to be saving you from typing 'node myapp.js' in a terminal.

I'm a VS-loving Windows dev by day (and sometimes by night) and quite like WebMatrix/WebPages/whatever the hell it's called. But IMHO the easiest way to get node running 'on Windows' is to spin up a Linux VM. npm alone is worth the effort.
September 18, 2011 21:47
Hanselman is a good guy but he is also selling books relating to Microsoft technology such as ASP.NET something or other and does speaking engagements. In these Node.js writeups, this is obviously a way to distract Microsoft devs from wanting to bail and move to Linux because of the shiny new Node.
September 19, 2011 21:36
Sebring - Actually, we want folks to use Windows. Doesn't matter if they use node or ASP.NET.
September 21, 2011 8:46
@scott re sebring: well played...

i installed everything in the simple list, but it is unable to launch node.

does this setup co-exist well with IIS installed? I know little about IIS Express, so...
September 23, 2011 3:13
Looks great, but how do I debug my code? I can't see anywhere the errors node gives me...only a 500 error.
ggg
October 16, 2011 18:02
just don't get it - I'm missing two of the most critical elements for a proper development environment:
1. a debugger. with iisnode the only debugger i've managed to use with node os far (node-inspecrot) is unusable.
2. code completion, of if you like - IntelliSense

without these I fill like developing with emacs in 1995 coding in C and debugging with printfs...
October 16, 2011 23:27
Ethan - I hear you and both are being looked at. Of course, you do realize that most node - or even many rails devs code without an interactive IDE debugger or intellisense.
October 19, 2011 6:12
Hey scott, Really awesome blog. Really cool. I would Like to know How to do the same for Web Host which has .net 4.0 how should I install node.js in webhost.
November 02, 2011 23:55
I’d like to add that Helicon Tech also has set of WebMatrix templates, including Node.js template plus Ruby on Rails, Django, Sinatra, Goliath, Mojolicious and Perl.

To use this you will only need Web Platform Installer and add a custom feed into it as explained on Helicon Zoo homepage: http://www.helicontech.com/zoo/

After that you navigate to Zoo->Packages->WebMatrix Templates and install. To run application you install Node.js form to Zoo->Packages->Node.js Hosting Package. This package includes Node.js, Helicon Zoo Module for IIS and IIS Express, rippy.py to replace NPM as it does not work on Windows yet and some other useful modules. Helicon Zoo Module (unlike iisnode module mentioned in this article) runs full featured HTTP stack, so you can utilize all asynchronous functions of Node.js, including comet (long polling).

Then to publish (deploy) your web site to a Windows based hosting, this hosting should also install Node.js Hosting Package from Zoo on a remote server. Some other applications, like databases, may be also required.

Any feedback is appreciated. Thank you!
December 08, 2011 3:08
Ok, Hanselman, this is kind of a rebuttal / apology .NET 4.5 has some cool asynchronous methods that don't tie up threads. I'm thinking Node.js is a waste of time now at least on Windows as that was the only reason to use Node.js for me in terms of the whole idea of being able to use long polling efficiently. I am all for .NET myself and prefer that over any for web stack because of ease of use and the Microsoft IDEs rock. I still strongly think Node.js is best left in the unix/linux world as github and npm and redis and couchdb all that jazz fit well together. I'm so happy about .NET 4.5 and will be trying long polling with jQuery as I way prefer doing it in c# and sql server.
December 10, 2011 10:49
Is there any way to use an older COM object from node?
December 20, 2011 6:28
Wondering why I haven't see a list like this before. Thanks for taking the time to put it together. Quality suggestions here and, because of the fact that all are free (donation ware), there is no reason not to try them out.

Comments are closed.

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.