部署Azure Web App(Angular)无法正常工作

时间:2018-11-13 06:07:02

标签: angular azure asp.net-core deployment azure-web-sites

基本的Asp.net Core Deploy没问题,但是Angular使Visual Studio 2017 Version Deploy无法正常工作。这是什么问题?

Azure部署日志:正在运行部署命令...(错误)

Command: "D:\home\site\deployments\tools\deploy.cmd"
Handling ASP.NET Core Web Application deployment.
Restore completed in 370.23 ms for
D:\home\site\repository\Developtive.Website\Developtive.Website.csproj.
Microsoft (R) Build Engine version 15.8.169+g1ccb72aefa for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

Restore completed in 157.22 ms for 
:\home\site\repository\Developtive.Website\Developtive.Website.csproj.

Developtive.Website -> 
:\home\site\repository\Developtive.Website\bin\Release\netcoreapp2.1
\Developtive.Website.dll

Developtive.Website -> 
:\home\site\repository\Developtive.Website\bin\Release\netcoreapp2.1
\Developtive.Website.Views.dll

EXEC : npm ERR! error : Method Not Allowed 
[D:\home\site\repository\Developtive.Website\Developtive.Website.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.28z\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! cwd D:\home\site\repository\Developtive.Website\ClientApp
npm ERR! node -v v0.10.40
npm ERR! npm -v 1.4.28
npm ERR! code E405
npm

D:\home\site\repository\Developtive.Website\Developtive.Website.csproj(38,5): error MSB3073: The command "npm install" exited with code 1.
Failed exitCode=1, command=dotnet publish "D:\home\site\repository\Developtive.Website\Developtive.Website.csproj" --output "D:\local\Temp\8d64929666d2c00" --configuration Release

An error has occurred during web site deployment.
\r\nD:\Program Files (x86)\SiteExtensions\Kudu\78.11022.3613\bin\Scripts\starter.cmd "D:\home\site\deployments\tools\deploy.cmd"

enter image description here

谢谢。

1 个答案:

答案 0 :(得分:4)

在“应用程序设置”下为WEBSITE_NODE_DEFAULT_VERSION设置有效版本。

enter image description here

推荐使用

8.11.1和10.6.0,有关Azure上的所有版本,请参见https://<webappname>.scm.azurewebsites.net/api/diagnostics/runtime