# IT:AD:Node.JS:HowTo:Install IISNode Module #
* [[../|(UP)]]
{{indexmenu>.#2|nsort tsort}}
* See also:
* [[IT/AD/Node.JS/HowTo/Install common Node.JS Tools]]
Use IISNode to install Node.JS in IIS.
## Process ##
### Prerequisites
* Ensure Url-Rewrite extension to IIS is installed: [http://www.iis.net/downloads/microsoft/url-rewrite](http://www.iis.net/downloads/microsoft/url-rewrite)

### IISNode Installer
I found the install rather rough. Not exactly sure why it started working ...
THe current IISNode no longer does the mistake that it used to -- namely that the the 64bit installer would look for node.js in the 64 bit path. It's no longer necessary, but know that the fix for that was to copy the whole c:\Program Files\NodeJS folder to the c:\Program Files (x64)\NodeJS folder. Then the installer would work.
* Download x64 package of IISNode.
* See: [https://github.com/tjanczuk/iisnode](https://github.com/tjanczuk/iisnode)
* Package: https://github.com/tjanczuk/iisnode/wiki/iisnode-releases
* Install, but note that 20121022 ran into this error, where it was looking for 32bit version of Node.JS:

The first part of the work around (discussed in [this thread](https://github.com/tjanczuk/iisnode/issues/178) is to copy the Node.js files to the target dir to fool the installer)
Then have to read [here](https://github.com/tjanczuk/iisnode/blob/master/src/samples/configuration/web.config) regarding setting `nodeProcessCommandLine` to point to real direction.
### IISNode Module
If you get past that, ensure the Module is installed:

### IISNode Default Web Site/Node samples website
Proceed with setting up samples, from the command prompt (in admin mode) call `%programfiles%\iisnode\setupsamples.bat`

Check that the website was created:

then go check that `http://localhost/node` exists
### Samples
#### TroubleShooting
The first time I navigated to the samples website, from the server itself, I got:

Ah. Yes. Newly created sample app in an site I usually shut down. Simple enough to fix:

#### Samples Index

#### Hello World
Navigating to the fist sample I got:

but then I got:

The error message simply leads to understanding that the web.config of the application has a web.config section to play with that gives a means to configure the IIS Module to know where to find node.js

But...unfortunately for me, it's right. It's pointing to:

#### Uninstall/Reinstall/Restart Server
Finally,

Yay.
## Resources ##
* Good early stuff: [http://weblogs.asp.net/jgalloway/archive/2011/10/26/using-node-js-in-an-asp-net-mvc-application-with-iisnode.aspx](http://weblogs.asp.net/jgalloway/archive/2011/10/26/using-node-js-in-an-asp-net-mvc-application-with-iisnode.aspx)
* [http://www.hanselman.com/blog/InstallingAndRunningNodejsApplicationsWithinIISOnWindowsAreYouMad.aspx](http://www.hanselman.com/blog/InstallingAndRunningNodejsApplicationsWithinIISOnWindowsAreYouMad.aspx)
* Hum....not so hot at handling requests....(2.5 secs slower than IIS itself...)