I have installed some modules via npm install <module> and I can access them when I run node at the command prompt, but when I run the app under IIS using iisnode, I get errors like:
Application has thrown an uncaught exception and is terminated:
Error: Cannot find module 'formidable'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (C:\Program Files\iisnode\www\helloworld\hello.js:3:18)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
What is going on? Is there a different way I have to install modules if I am using iisnode?
Here is my web.config file from the project:
<configuration>
<system.webServer>
<!-- indicates that the hello.js file is a node.js application
to be handled by the iisnode module -->
<handlers>
<add name="iisnode" path="hello.js" verb="*" modules="iisnode" />
</handlers>
</system.webServer>
</configuration>
web.configfile. I'm not sure what else to add, everything else is the same as the defaults.