【问题标题】:Nodejs node not getting start in Azure?Nodejs 节点没有在 Azure 中启动?
【发布时间】:2018-06-07 15:09:51
【问题描述】:

我有一个需要继续运行的 nodejs 应用程序。该应用程序部署在 azure 中。但它没有启动。当我尝试通过 kudu 控制台键入“node app.js”来运行该应用程序时工作正常。但是一旦部署它就不起作用。Package.json 文件有脚本启动脚本。可能是什么原因。

 "main": "app.js",
  "scripts": {
    "start": "node app.js",
    "test": "echo \"Error: no test specified\" && exit 1"
  },

azure的kudu控制台链接。

https://appname.scm.azurewebsites.net/DebugConsole

【问题讨论】:

    标签: node.js azure


    【解决方案1】:

    如果您的应用程序在启动时返回 500 错误,可能有以下几个原因:

    • Node.exe 不在正确的位置。查看 nodeProcessCommandLine 设置。
    • 主脚本文件不在正确的位置。查看 web.config 并确保主脚本文件的名称在 handlers 部分与主脚本文件匹配。
    • Web.config 配置不正确 - 检查设置 名称/值。
    • 冷启动 - 您的应用程序启动时间过长。如果你的 应用程序花费的时间超过(maxNamedPipeConnectionRetry * namedPipeConnectionRetryDelay) / 1000 秒,iisnode 返回一个 500 错误。增加这些设置的值以匹配您的 应用程序启动时间,以防止 iisnode 超时和 返回 500 错误。

    更多详情请参考Best practices and troubleshooting guide for node applications on Azure Web Apps

    您也可以查看Azure webapp node.js app not starting

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-07-15
      • 2023-03-04
      • 2019-10-31
      相关资源
      最近更新 更多