2012-10-26 12 views
6

में नोड ऐप चलाने में त्रुटि मैंने वेबमैट्रिक्स स्थापित किया और these निर्देशों को अपने विंडोज 7 मशीन पर आईआईएस 7 स्थापित करने के लिए निर्देश दिए।वेबमैट्रिक्स

<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

यदि आप वेबसाइट से नोड के x64 संस्करण को स्थापित करते हैं तो यह एक आम समस्या है। वर्तमान में IISNode को x32 पथ से node.exe पढ़ने के लिए सेट किया गया है। आप या तो अपने बॉक्स पर node.exe के पूर्ण पथ का उपयोग करने के लिए nodeProcessCommandLine को बदल सकते हैं, या 32 बिट नोड इंस्टॉल स्थापित कर सकते हैं। हम इसे ठीक करने पर काम कर रहे हैं इसलिए 32/64 बिट दोनों बॉक्स से बाहर काम करेंगे। मुझे पता है कि अगर यह पता चला है समस्या :)

+1

'"% प्रोग्रामफाइल% \ nodejs \ node.exe "" पूरा पथ नहीं है? –

+1

मैंने 32-बिट संस्करण स्थापित किया और हाँ - यह अब काम कर रहा है। जस्टिन बहुत बहुत धन्यवाद। –

+2

मेरे पास एक ही समस्या थी और सभी सुधारों को लागू किया गया था (x86 इंस्टॉल करना या वेब.कॉन्फिग संपादित करना या सिमलिंक डालना) यहां सुझाए गए और अन्य स्थानों का कोई फायदा नहीं हुआ। यह पता चला है कि इन फ़िक्स को लागू करने के बाद आपको पावरहेल या कमांड प्रॉम्प्ट से निम्न आदेशों के साथ WAS को पुनरारंभ करना होगा: "नेट स्टॉप था" और "नेट स्टार्ट w3svc" एक बार जब मैं उन आदेशों को चलाता हूं तो फिक्स काम करता है। मैंने इसे इस विशिष्ट त्रुटि के लिए समस्या पृष्ठ पर पाया: https://github.com/tjanczuk/iisnode/issues/302 – Conor

21
Node.js (64-बिट) के साथ

नहीं हो सकता है, web.config के निचले भाग में इस रखने 32 स्थापित करने

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

यह मेरे लिए काम किया - धन्यवाद – markbarton

+0

इससे मुझे भी मदद मिली। '% प्रोगाफाइल%' पर्यावरण चर विस्तारित प्रतीत नहीं होता है। वहां पर मूल्य हार्डकोडिंग काम किया। –

+0

जानकारी के लिए धन्यवाद, एक आकर्षण की तरह काम! –

6

के बजाय कोशिश करते हैं -बिट संस्करण, आप 64-बिट पथ से 32-बिट पथ से एक प्रतीकात्मक लिंक बना सकते हैं।

cmd.exe प्रॉम्प्ट पर:

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

आश्चर्यजनक है कि यह अभी भी तय नहीं है और web.config सेटिंग को अनदेखा किया जा रहा है।

संबंधित मुद्दे