angular - 发布到 Azure 后的 ENOENT

标签 angular azure npm asp.net-core-2.0

我真的希望有人能够阐明这里发生的事情。

我正在将 Angular 7/.Net Core 2 应用程序发布到 Azure。我正在 Visual Studio 中使用提供的 Azure 发布配置文件。

当我在本地运行该应用程序时,它运行得非常好。部署后,我看到一串错误消息,大部分来自 npm 有关 package.json 文件的错误消息。

An unhandled exception occurred while processing the request. AggregateException: One or more errors occurred. (One or more errors occurred. (The NPM script 'start' exited without indicating that the Angular CLI was listening for requests. The error output was: npm ERR! Error: ENOENT, open 'D:\home\site\wwwroot\ClientApp\node_modules\start\package.json'

npm ERR! { [Error: ENOENT, open 'D:\home\site\wwwroot\ClientApp\node_modules\start\package.json']

npm ERR! errno: 34,

npm ERR! code: 'ENOENT',

npm ERR! path: 'D:\home\site\wwwroot\ClientApp\node_modules\start\package.json' }

npm ERR! You may report this log at:

npm ERR! http://github.com/isaacs/npm/issues

npm ERR! or email it to:

npm ERR!

Example of the full stack

最佳答案

您必须通过 Kudu 控制台或 FTP 将 dist/my-app 目录下的所有文件复制到 Azure WebApp 的 wwwroot 目录中。更好的方法是使用持续部署。

enter image description here

关于angular - 发布到 Azure 后的 ENOENT,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58416931/

相关文章:

c# - 在 Azure 应用程序中为两个存储帐户设置依赖项注入(inject)

node.js - Azure Pipeline - 使用 Azure Feed 进行 npm 安装错误 403

angular - 如何从 component.ts 文件中的 Angular 2 中的 json 响应获取键/值对

angular - PowerShell 脚本添加 '--prod' 参数以构建 Angular CLI 项目

javascript - 回调在 Angular2/Firebase 中生成 "TypeError: this is undefined"

c# - Azure Function - "PartitionKey extracted from document doesn' t 与在门户中创建的容器上的 header 中指定的匹配

angular - 如何在鼠标悬停时显示 Angular Material 下拉菜单?

azure - Azure 区 block 链工作台中通过 REST API 调用创建的帐户的登录凭据是什么?

node.js - Apache Cordova 安装错误

jquery - npm install jquery 在 node-gyp 重建时失败