Last Updated: February 25, 2016
·
1.022K
· harshadkale

WebMatrix + x64 Node.JS + Express

If you are using Microsoft's WebMatrix (maybe because Visual Studio does not support JADE files yet) for your Node.JS adventures, and have x64 version of Node installed, here's what you need to do to make WebMatrix (actually IISNode) capable to run your app -

In the Web.config file of your app, add this section at the bottom

<iisnode watchedFiles="*.js;node_modules\*;routes\*.js;views\*.jade"  nodeProcessCommandLine="C:\program files\nodejs\node.exe"/>

If you google around and you may find that it is already suggested to add this chunk to make it work but all of those suggestions say add -

<iisnode watchedFiles="*.js;node_modules\*;routes\*.js;views\*.jade"  nodeProcessCommandLine="&quot;%programfiles%\nodejs\node.exe&quot;"/>

but somehow that never worked for me until I hard coded the path to my node.exe.

P.S. for all those who are wondering if my system does not understand what %programfiles% variable is, hold on. It actually does. it prints the value for it if I echo this variable on command line and I believe this variable is added in systems variables by default. Correct me here if I am wrong but this tip worked for me.