【问题标题】:iisnode module is unable to start the node.exe processiisnode 模块无法启动 node.exe 进程
【发布时间】:2018-05-09 01:10:34
【问题描述】:

您好,我正在尝试在 IIS 上运行节点作为现有网站的子目录。

https://somewebsite/node 喜欢这样

  1. 下载安装到windows机器https://github.com/azure/iisnode/wiki/iisnode-releases

它可以工作,但是当我转到特定的 js 文件时,我收到了这条消息,不知道该怎么做。

iisnode 模块无法启动 node.exe 进程。确保 node.exe 可执行文件在 web.config 的 system.webServer/iisnode/@nodeProcessCommandLine 元素中指定的位置可用。默认情况下,node.exe 应位于 PATH 环境变量中列出的目录之一中。

【问题讨论】:

    标签: node.js iis iisnode


    【解决方案1】:

    在 web.config 文件中添加了以下代码,它可以工作了!

    <iisnode nodeProcessCommandLine="C:\Program Files\nodejs\node.exe" />
    

    【讨论】:

    • 因为 iisnode 安装需要 nodejs 安装在位置“程序文件(x86)”,对我来说,它通过对路径稍作更改来工作:
    • 非常有用的答案,确实必须为node.exe路径引导IISNODE
    【解决方案2】:

    你应该考虑两个重要的点。

    1. 检查“system.webServer/iisnode”上node.exe的路径。
    2. 检查您是否从official site 安装了nodejs。您必须能够在默认路径中找到 node.exe:C:\Program Files\nodejs\node.exe

    我建议您阅读this article 以在“system.webServer/iisnode”上设置节点的正确路径。

    【讨论】:

      【解决方案3】:

      我有工作节点 6x 和 iisnode。当我在我的 Windows 8 上为 Angular 7 安装节点 8x 时,由于 rest API 调用,我得到了同样的错误

      对我来说,只需要在 Windows 环境变量中添加 node.exe 的路径,iisnode 就像以前一样工作

      【讨论】:

        【解决方案4】:

        在windows服务器中

        首先你应该检查环境路径

        C:\&gt; Path

        从其他包管理器中删除所有以前的安装和卸载 nodejs

        然后从nodejs.org/download page下载64位msi安装程序

        然后重新安装

        然后重启服务器

        然后你可以在 Web.Config 中再次评论这一行

          <!--     
            
            One more setting that can be modified is the path to the node.exe executable and the interceptor:
            
            <iisnode
              nodeProcessCommandLine="&quot;%programfiles%\nodejs\node.exe&quot;" 
              interceptor="&quot;%programfiles%\iisnode\interceptor.js&quot;" />
            
            -->
        

        【讨论】:

          【解决方案5】:

          通过设置 C:\Program Files\iisnode\www\configuratio\web.config 中的值并不总是能解决问题。请按照以下步骤尝试在 IIS 服务器级别进行设置。

          1. 选择 IIS 服务器并打开配置编辑器https://www.screencast.com/t/SWcy4C5m

          2. 选择部分 system.webServer/iisnode 并将 nodeProcessCommandLine 值设置为 node.exe 完整路径。 https://www.screencast.com/t/e8N6MFeWEueS

          这解决了我的问题。希望这对某人有所帮助。

          【讨论】:

            猜你喜欢
            • 2023-03-18
            • 1970-01-01
            • 1970-01-01
            • 2019-12-01
            • 2015-05-01
            • 1970-01-01
            • 2017-12-11
            • 1970-01-01
            • 1970-01-01
            相关资源
            最近更新 更多