IIS 8 nodejs + iisnode 配置

來源:互聯網
上載者:User

標籤:style   blog   http   io   color   ar   sp   for   檔案   

最近再Server 2012 + IIS 8 中配置NodeJS 運行環境,具體配置過程就不細說了(隨便搜搜一堆),安裝完nodejs 和 iisnode 之後,出現一個報錯,如下:

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 variable

 

google 了半天,剛開始以為是x86NodeJS安裝路徑的問題,後來倒騰半天始終不對,後來找到篇文章 https://admin-ahead.com/forum/websitepanel/node-js-error!/

解決方案:在web.config 》system.webServer 節點加上:

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

問題解決,我鳥個去,希望能協助到後面遇到此問題的童靴,我的web.config 檔案如下,供參考:

 

<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>

 

IIS 8 nodejs + iisnode 配置

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.