node.js - How to correct IISNode HTTP 500 substatus 1002 process request error
问题描述
I am getting the following error when trying to host an application in Windows IIS using IISNode.
iisnode encountered an error when processing the request.
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:
Application has thrown an uncaught exception and is terminated:
Error: EPERM: operation not permitted, lstat 'C:\path\to\project'
at Object.fs.lstatSync (fs.js:893:18)
at Object.realpathSync (fs.js:1527:21)
at toRealPath (module.js:132:13)
at Function.Module._findPath (module.js:180:22)
at Function.Module._resolveFilename (module.js:470:25)
at Function.Module._load (module.js:420:25)
at Module.require (module.js:500:17)
at require (internal/module.js:20:19)
at Object. (C:\Program Files\iisnode\interceptor.js:210:1)
at Module._compile (module.js:573:32)
I have tried changing the server to listen on process.env.PORT
and am still having issues.
And also setting
<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""
/>
in the web.config
file.
解决方案
运行npm cache clear --force
解决了这个问题。
推荐阅读
- rust - 不能使用 format_args!由于临时值在此语句的末尾被释放
- java - 为什么我在这里使用方法引用或 lambda 很重要?
- mysql - `utf8_general_ci' 是弃用字符集 UTF8MB3 的排序规则
- python - 为什么不能用 `|` 将两个正则表达式合二为一?
- asp.net-mvc - 在添加 MVC 控制器中添加自定义视图
- java - 视差滚动在协调器布局中不起作用?
- node.js - 使用 Passport LocalStrategy、knex 和 postgres 的意外令牌错误
- c++ - 优先级队列中比较器功能的工作
- docker - Building docker image results in double size
- php - Amazon S3 将 .mp3 和 .wav 文件下载为 .zip