【发布时间】:2020-01-16 21:47:49
【问题描述】:
尝试使用 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:
应用程序抛出未捕获的异常并终止:
错误:EPERM:不允许操作,lstat 'C:\path\to\project'
在 Object.fs.lstatSync (fs.js:893:18)
在 Object.realpathSync (fs.js:1527:21)
在 toRealPath (module.js:132:13)
在 Function.Module._findPath (module.js:180:22)
在 Function.Module._resolveFilename (module.js:470:25)
在 Function.Module._load (module.js:420:25)
在 Module.require (module.js:500:17)
在需要(内部/module.js:20:19)
在对象。 (C:\Program Files\iisnode\interceptor.js:210:1)
在 Module._compile (module.js:573:32)
我已尝试将服务器更改为监听 process.env.PORT,但仍然遇到问题。
还有设置
<rewrite>
<rules>
<rule name="sendToNode">
<match url="/*" />
<action type="Rewrite" url="server.js" />
</rule>
</rules>
</rewrite>
<iisnode
nodeProcessCommandLine=""%programfiles%\nodejs\node.exe""
interceptor=""%programfiles%\iisnode\interceptor.js""
/>
在web.config 文件中。
【问题讨论】: