2012-10-26 7 views
6

'da düğüm uygulaması çalıştırılırken hata oluştu WebMatrix'i yükledim ve IIS 7'yi Windows 7 makineme yüklemek için these yönergeleri izledim. Bu neden oluyor NeWebMatrix

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

:

benim ekspres düğüm Uygulamayı çalıştırmak için 'Çalıştır' tıkladığınızda, tarayıcı açılır ve bana söyler Burada

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.

benim web.config olduğunu sorun ve nasıl düzeltebilirim?

cevap

10

Web sitesinden düğümün x64 sürümünü yüklediyseniz, bu yaygın bir sorundur. Şu anda IISNode, x32 yolundan node.exe dosyasını okumak için ayarlanmıştır. NodeProcessCommandLine kutusunu, kutunuzdaki node.exe dosyasının tam yolunu kullanacak şekilde değiştirebilir veya 32 bit düğüm yüklemesini yükleyebilirsiniz. Bunu düzeltmek için çalışıyoruz, böylece hem 32/64 bit kutunun dışında çalışacak. Bu, web.config altındaki bu yerleştirerek

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

""% programfiles% \ nodejs \ node.exe "" 'Tam yol değil mi? –

+1

32 bit sürümü yükledim ve evet - şimdi çalışıyor. Çok teşekkür ederim Justin. –

+2

Aynı sorunu yaşadım ve tüm düzeltmeleri (x86 yükleme veya web.config'i düzenleme veya sembolik bağlantı kurma) önerdim. Size bu düzeltmeleri uyguladıktan sonra da Powershell veya komut istemi aşağıdaki komutlarla WAS yeniden başlatmanız çıkıyor: O komutları koştum "net durağıydı" & "W3svc net start" düzeltme çalıştı. Bu özel hata için bu konu sayfasında bulundu: https://github.com/tjanczuk/iisnode/issues/302 – Conor

21

olamaz çıkarsa bana haber ver -bit sürümü, 32 bit yoldan 64 bitlik bir sembolik bağlantı oluşturabilirsiniz. cmd.exe isteminde

:

bu hala sabit değildir ve web.config ayarı yok gibi görünüyor
mklink /D "C:\Program Files (x86)\nodejs" "C:\Program Files\nodejs" 

Şaşırtıcı söyledi.

+2

Bu benim için çalıştı - teşekkürler – markbarton

+0

Bu da bana yardımcı oldu. '% ProgamFiles%' ortam değişkeni genişlemiyor gibi görünmektedir. Hardcoding orada değer çalıştı. –

+0

Bilgi için teşekkürler, çekicilik gibi çalışın! –

6

yerine 32 yüklemeyi deneyin sorun :) node.js (64-bit) ile