2012-10-26 20 views
6

Zainstalowałem WebMatrix i postępowałem zgodnie z instrukcjami these, aby zainstalować IIS 7 na moim komputerze z systemem Windows 7.Błąd podczas uruchamiania aplikacji węzła w WebMatrix

Po kliknięciu „Uruchom”, aby uruchomić aplikację mojego wyraźnego węzła, przeglądarka wyskakuje i mówi mi

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.

Oto moja web.config:

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

Co jest tego przyczyną problem i jak to naprawić?

Odpowiedz

10

Jest to typowy problem, jeśli zainstalowano wersję x64 węzła ze strony internetowej. Obecnie IISNode jest skonfigurowany do odczytu node.exe ze ścieżki x32. Możesz zmienić węzełProcessCommandLine, aby użyć pełnej ścieżki do node.exe w polu lub zainstalować instalację węzła 32-bitowego. Pracujemy nad naprawieniem tego, aby zarówno wersja 32/64 bitowa działała po wyjęciu z pudełka. Daj mi znać, jeśli to okazuje się nie być problemem :)

+1

Czy '" "% plik_programów% \ nodejs \ node.exe " "' nie pełna ścieżka? –

+1

Zainstalowałem wersję 32-bitową i tak - teraz działa. Dziękuję bardzo Justin. –

+2

Miałem ten sam problem i zastosowałem wszystkie poprawki (instalując x86 lub edytując web.config lub umieszczając dowiązanie symboliczne) zasugerowane tutaj i inne miejsca bez skutku. Okazuje się, że po zastosowaniu tych poprawek należy również zrestartować serwer WAS za pomocą następujących poleceń z Powershell lub wiersza polecenia: "net stop was" i "net start w3svc" Po uruchomieniu tych poleceń poprawka działała. Znalazłem to na stronie wydania dla tego konkretnego błędu: https://github.com/tjanczuk/iisnode/issues/302 – Conor

21

z node.js (64-bit), spróbuj umieścić ten na dole web.config

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

To zadziałało dla mnie - dzięki – markbarton

+0

Pomogło mi to również. Zmienna środowiskowa '% ProgamFiles%' nie wydaje się rozszerzać. Kodowanie na twardo wartości tam działało. –

+0

dzięki za informacje, działa jak urok! –

6

Zamiast instalowania 32 -bitowa wersja, możesz utworzyć dowiązanie symboliczne z 32-bitowej ścieżki do 64-bitowej.

W wierszu cmd.exe:

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

Zaskakujące, że to jeszcze nie jest ustalona, ​​a ustawienie web.config wydaje się być ignorowane.

Powiązane problemy