我已经安装了一些模块,当我在命令提示符下npm install <module>
运行时我可以访问它们,但是当我在 IIS 下使用 运行应用程序时,我收到如下错误:node
iisnode
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)
到底是怎么回事?如果我正在使用,是否有不同的方式安装模块iisnode
?
这是我web.config
的项目文件:
<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>