IIS 8 nodejs + iisnode 配置

最近再Server 2012 + IIS 8 中配置NodeJS 运行环境,具体配置过程就不细说了(随便搜搜一堆),安装完nodejs 和 iisnode 以后,出现一个报错,以下:node

The iisnode module is unable to start the node.exe process. Make sure the node.exe executable is available at the location specified in the system.webServer/iisnode/@nodeProcessCommandLine element of web.config. By default node.exe is expected in one of the directories listed in the PATH environment variableweb

 

google 了半天,刚开始觉得是x86NodeJS安装路径的问题,后来倒腾半天始终不对,后来找到篇文章 https://admin-ahead.com/forum/websitepanel/node-js-error!/app

解决方法:在web.config 》system.webServer 节点加上:google

<iisnode watchedFiles="*.js;node_modules\*;routes\*.js;views\*.jade"  nodeProcessCommandLine="C:\Program Files\node.exe"/>spa

问题解决,我鸟个去,但愿能帮助到后面遇到此问题的童靴,个人web.config 文件以下,供参考:code

 

<configuration>
    <system.webServer>
        <handlers>
                <remove name="nodejs" />
            <!-- indicates that the server.js file is a node.js application to be handled by the iisnode module -->
            <add name="iisnode" path="server.js" verb="*" modules="iisnode" />
        </handlers>

        <iisnode watchedFiles="*.js;node_modules\*;routes\*.js;views\*.jade"  nodeProcessCommandLine="C:\Program Files\node.exe"/>
    </system.webServer>
</configuration>
相关文章
相关标签/搜索