为什么应用设置后 Kudu 节点版本没有更新?

Why is Kudu node version not updating after setting is applied?

我一直在尝试将 Angular 应用程序部署到 Azure 应用服务,但部署失败并提供以下日志:

Command: "D:\home\site\deployments\tools\deploy.cmd"
Handling ASP.NET Core Web Application deployment.
  Restore completed in 862 ms for D:\home\site\repository\src\Bearbersys.ui\Bearbersys.ui.csproj.
Microsoft (R) Build Engine version 15.9.20+g88f5fadfbe for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

  Restore completed in 418.94 ms for D:\home\site\repository\src\Bearbersys.ui\Bearbersys.ui.csproj.
  Bearbersys.ui -> D:\home\site\repository\src\Bearbersys.ui\bin\Release\netcoreapp2.2\Bearbersys.ui.dll
  Bearbersys.ui -> D:\home\site\repository\src\Bearbersys.ui\bin\Release\netcoreapp2.2\Bearbersys.ui.Views.dll
EXEC : npm ERR! error : Method Not Allowed [D:\home\site\repository\src\Bearbersys.ui\Bearbersys.ui.csproj]
  npm ERR!     at errorResponse (D:\Program Files (x86)\npm.4.28\node_modules\npm\lib\cache\add-named.js:260:10)
  npm ERR!     at D:\Program Files (x86)\npm.4.28\node_modules\npm\lib\cache\add-named.js:203:12
  npm ERR!     at saved (D:\Program Files (x86)\npm.4.28\node_modules\npm\node_modules\npm-registry-client\lib\get.js:167:7)
  npm ERR!     at Object.oncomplete (fs.js:108:15)
  npm ERR! If you need help, you may report this *entire* log,
  npm ERR! including the npm and node versions, at:
  npm ERR!     <http://github.com/npm/npm/issues>

  npm ERR! System Windows_NT 6.2.9200
  npm ERR! command "node" "D:\Program Files (x86)\npm\1.4.28\node_modules\npm\bin\npm-cli.js" "install"
  npm ERR! cwd D:\home\site\repository\src\Bearbersys.ui\ClientApp
  npm ERR! node -v v0.10.40
  npm ERR! npm -v 1.4.28
  npm ERR! code E405
D:\home\site\repository\src\Bearbersys.ui\Bearbersys.ui.csproj(39,5): error MSB3073: The command "npm install" exited with code 1.
Failed exitCode=1, command=dotnet publish "D:\home\site\repository\src\Bearbersys.ui\Bearbersys.ui.csproj" --output "D:\local\Tempd6e13963485ed1" --configuration Release
An error has occurred during web site deployment.
\r\nD:\Program Files (x86)\SiteExtensions\Kudu.10329.3844\bin\Scripts\starter.cmd "D:\home\site\deployments\tools\deploy.cmd"

经过一番研究,我发现这与我的应用服务中的节点包有关,因此我尝试向其中添加以下应用程序设置:

[
  {
    "name": "WEBSITE_NODE_DEFAULT_VERSION",
    "value": "10.15.3",
    "slotSetting": false
  }
]

10.15.3 是当前节点版本,与我创建 Angular 应用程序时安装在我的计算机中的版本相同,即使成功应用设置,重新部署后错误仍然存​​在。我还注意到日志显示的节点版本没有改变

  npm ERR! node -v v0.10.40
  npm ERR! npm -v 1.4.28

我可能做错了什么?

nodejs发布时间表请参考:https://github.com/nodejs/Release

查找 Azure Windows WebApps 中可用的当前 nodejs 版本,导航到此 link:

https://<yourwebappname>.scm.azurewebsites.net/api/diagnostics/runtime

您只能使用此列表中的可用版本。

定期添加新版本,因此请使用上面的 /api/diagnostics/runtime url 检查是否有更新的版本。