代码之家  ›  专栏  ›  技术社区  ›  Matthew

如何更正IISNode 500:1002进程请求错误

  •  0
  • Matthew  · 技术社区  · 6 年前

    尝试使用IISNode在Windows IIS中托管应用程序时,我遇到以下错误。

    iisnode在处理请求时遇到错误。

    HRESULT: 0x2
    HTTP status: 500
    HTTP subStatus: 1002
    HTTP reason: Internal Server Error
    
    You are receiving this HTTP 200 response because 
    system.webServer/iisnode/@devErrorsEnabled configuration setting is 'true'.
    
    In addition to the log of stdout and stderr of the node.exe process, 
    consider using debugging and ETW traces to further diagnose the problem.
    
    The last 64k of the output generated by the node.exe process 
    to stderr is shown below:
    

    在Object.fs.lstatSync(fs.js:893:18)
    在Object.realpathSync(fs.js:1527:21)

    在Function.Module.\u findPath(Module.js:180:22)
    在Function.Module.\u解析文件名(Module.js:470:25)

    at Module.require(Module.js:500:17)
    根据需要(内部/module.js:20:19)

    我已尝试将服务器更改为侦听 process.env.PORT 我仍然有问题。

    <rewrite>
      <rules>
        <rule name="sendToNode">
          <match url="/*" />
          <action type="Rewrite" url="server.js" />
        </rule>
      </rules>
    </rewrite>
    
    <iisnode 
      nodeProcessCommandLine="&quot;%programfiles%\nodejs\node.exe&quot;"
      interceptor="&quot;%programfiles%\iisnode\interceptor.js&quot;"
    />
    

    web.config

    1 回复  |  直到 6 年前
        1
  •  0
  •   p4cm4n972 Matthew    6 年前

    npm cache clear --force 解决了这个问题。