2012-10-26 29 views
6

Windows 7マシンにIIS 7をインストールするために、WebMatrixをインストールして、theseの手順に従っています。この原因は何WebMatrixでノードアプリケーションを実行中にエラーが発生しました

<configuration> 
<system.webServer> 

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

<rewrite> 
    <rules> 
    <!-- Don't interfere with requests for logs --> 
    <rule name="LogFile" patternSyntax="ECMAScript" stopProcessing="true"> 
     <match url="^[a-zA-Z0-9_\-]+\.js\.logs\/\d+\.txt$" /> 
    </rule> 

    <!-- Don't interfere with requests for node-inspector debugging --> 
    <rule name="NodeInspector" patternSyntax="ECMAScript" stopProcessing="true"> 
     <match url="^app.js\/debug[\/]?" /> 
    </rule> 

    <!-- First we consider whether the incoming URL matches a physical file in the /public folder --> 
    <rule name="StaticContent"> 
     <action type="Rewrite" url="public{REQUEST_URI}" /> 
    </rule> 

    <!-- All other URLs are mapped to the Node.js application entry point --> 
    <rule name="DynamicContent"> 
     <conditions> 
     <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="True" /> 
     </conditions> 
     <action type="Rewrite" url="app.js" /> 
    </rule> 
    </rules> 
</rewrite> 

<!-- You can control how Node is hosted within IIS using the following options --> 
<!--<iisnode  
     node_env="%node_env%" 
     nodeProcessCountPerApplication="1" 
     maxConcurrentRequestsPerProcess="1024" 
     maxNamedPipeConnectionRetry="3" 
     namedPipeConnectionRetryDelay="2000"  
     maxNamedPipeConnectionPoolSize="512" 
     maxNamedPipePooledConnectionAge="30000" 
     asyncCompletionThreadCount="0" 
     initialRequestBufferSize="4096" 
     maxRequestBufferSize="65536" 
     watchedFiles="*.js" 
     uncFileChangesPollingInterval="5000"  
     gracefulShutdownTimeout="60000" 
     loggingEnabled="true" 
     logDirectoryNameSuffix="logs" 
     debuggingEnabled="true" 
     debuggerPortRange="5058-6058" 
     debuggerPathSegment="debug" 
     maxLogFileSizeInKB="128" 
     appendToExistingLog="false" 
     logFileFlushInterval="5000" 
     devErrorsEnabled="true" 
     flushResponse="false"  
     enableXFF="false" 
     promoteServerVars="" 
    />--> 

    <iisnode  
    nodeProcessCommandLine="&quot;%programfiles%\nodejs\node.exe&quot;" 
    interceptor="&quot;%programfiles%\iisnode\interceptor.js&quot;" 
    /> 
</system.webServer> 
</configuration> 

私は特急ノードアプリを実行するために、「ファイル名を指定して実行」をクリックすると、ブラウザがポップアップし、私に語った。ここ

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 to be installed in %ProgramFiles%\nodejs folder on x86 systems and %ProgramFiles(x86)%\nodejs folder on x64 systems.

は私のweb.configファイルであります問題は、どのように私はそれを修正するのですか?

答えて

10

これは、Webサイトからノードのx64バージョンをインストールした場合によく発生する問題です。現在、IISNodeは、x32パスからnode.exeを読み取るように設定されています。 nodeProcessCommandLineを変更して、ボックスのnode.exeへのフルパスを使用するか、または32ビットノードのインストールをインストールすることができます。私たちはこれを修正するために作業していますので、32/64ビットはどちらもそのまま使えます。これは、web.configファイルの一番下にこれを置く

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

'' "%programfiles%\ nodejs \ node.exe " "はフルパスではありませんか? –

+1

私は32ビットバージョンをインストールしました。はい、今動作しています。ありがとう、ジャスティン。 –

+2

私は同じ問題を抱えていましたが、ここや他の場所には何の問題もなく、すべての修正(x86のインストールやweb.configの編集、シンボリックリンクの編集など)を適用しました。これらの修正プログラムを適用した後、Powershellまたはコマンドプロンプトから次のコマンドを使用してWASを再起動する必要があります。 "net stop was"& "net start w3svc" これらのコマンドを実行すると修正が機能しました。この特定のエラーの問題ページでこれが見つかりました:https://github.com/tjanczuk/iisnode/issues/302 – Conor

21

でないことが判明した場合、私に教えてください32ビット・パスから64ビット・パスへのシンボリック・リンクを作成することができます。プロンプトcmd.exe

mklink /D "C:\Program Files (x86)\nodejs" "C:\Program Files\nodejs" 

が、これはまだ固定されていないとweb.config設定は無視しているように見えることは驚くべきこと。

+2

これは私のために働いた - ありがとう – markbarton

+0

これはまた私を助けた。 '%ProgamFiles%'環境変数は展開されていないようです。その中の値をハードコーディングしていました。 –

+0

感謝の気持ちで情報に感謝! –

6

の代わりに32をインストールしてみてください問題:) Node.jsの(64ビット)と

関連する問題