Angular 将.NetCore.6发布到Azure时出错
我有一个应用程序在本地运行良好,但在Azure AppService中运行时出现错误: InvalidOperationException:NPM脚本“start”退出,但未指示Angular CLI正在侦听请求。错误输出为:npm ERR!错误:enoint,打开“D:\home\site\wwwroot\ClientApp\node\u modules\start\package.json”Angular 将.NetCore.6发布到Azure时出错,angular,azure,angular6,asp.net-core-2.0,Angular,Azure,Angular6,Asp.net Core 2.0,我有一个应用程序在本地运行良好,但在Azure AppService中运行时出现错误: InvalidOperationException:NPM脚本“start”退出,但未指示Angular CLI正在侦听请求。错误输出为:npm ERR!错误:enoint,打开“D:\home\site\wwwroot\ClientApp\node\u modules\start\package.json” 如果有人认为他们可以提供帮助,我可以提供更多信息。错误是关于角度路线,服务无法识别它们 您是否创建了
如果有人认为他们可以提供帮助,我可以提供更多信息。错误是关于角度路线,服务无法识别它们 您是否创建了webconfig文件 我也犯了同样的错误,并且能够像以前一样修复它
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Angular Routes" stopProcessing="true">
<match url=".*NEWPDS.*" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="./index.html" />
</rule>
</rules>
<outboundRules>
</outboundRules>
</rewrite>
</system.webServer>
</configuration>
当使用IIS时。您试图在Azure上以开发模式启动angular应用程序?这就是问题所在,我该如何进入发布模式?运行
ng build--prod
它将在dist目录中生成编译的静态文件,然后您可以像其他静态文件一样公开静态文件。我尝试在my.csProj的根目录中添加一个静态文件。同样的错误,我担心你必须声明你正在使用一个web配置文件来进行类似的操作;“应用程序”:[{“root”:“src”,“outDir”:“dist”,“assets”:[“images”,“favicon.ico”,“web.config”],“index”:“index.html”,“main”:“main.ts”,“polyfills”:“polyfills.ts”,“test”:“test.ts”,我找到了一个教程,认为我需要继续学习,因为我的angular.json文件与您的文件看起来非常不同。谢谢Kutlu,您的建议很好。我重新开始,这很有效:)