我一直试图将Angular应用程序部署到Azure App Service,部署失败,并且显示以下日志:
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\1.4.28\node_modules\npm\lib\cache\add-named.js:260:10)
npm ERR! at D:\Program Files (x86)\npm\1.4.28\node_modules\npm\lib\cache\add-named.js:203:12
npm ERR! at saved (D:\Program Files (x86)\npm\1.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\Temp\8d6e13963485ed1" --configuration Release
An error has occurred during web site deployment.
\r\nD:\Program Files (x86)\SiteExtensions\Kudu\81.10329.3844\bin\Scripts\starter.cmd "D:\home\site\deployments\tools\deploy.cmd"
经过研究,我发现这与我的App Service中的节点包有关,因此我尝试向其添加以下应用程序设置:
[
{
"name": "WEBSITE_NODE_DEFAULT_VERSION",
"value": "10.15.3",
"slotSetting": false
}
]
10.15.3
是当前节点版本,也是我创建Angular App时在计算机上安装的相同版本,即使成功应用了该设置,在重新部署后错误仍然存在。我还注意到日志显示的节点版本未更改。
npm ERR! node -v v0.10.40
npm ERR! npm -v 1.4.28
我可能做错了什么?
答案 0 :(得分:0)
有关nodejs的发布时间表,请参阅:https://github.com/nodejs/Release
查找Azure Windows WebApp中可用的当前nodejs版本,导航至此链接:
https://<yourwebappname>.scm.azurewebsites.net/api/diagnostics/runtime
您只能使用此列表中可用的版本。
新版本会定期添加,因此请使用上面的/api/diagnostics/runtime
网址检查新版本。