angular - NX Monorepo 的 Azure 静态 Web 应用程序部署管道错误

标签 angular azure yaml azure-pipelines azure-pipelines-yaml

我正在尝试部署 Nx Monorepository 内的 Angular 应用程序,但收到此错误:

Detecting platforms...

Could not detect any platform in the source directory.

Error: Could not detect the language from repo.

enter image description here

部署管道如下所示:

trigger:
- master
- main
- pipeline

pool:
  vmImage: ubuntu-latest
steps:

- task: NodeTool@0
  inputs:
    versionSpec: '16.x'

- task: CmdLine@2
  displayName: 'Directory listing'
  inputs:
    script: |
      cd $(Agent.BuildDirectory)/apps/luis
      ls -Rla

- script: |
    cd ./apps/luis/
    npm install --location=global @angular/cli
    npm install
    npm run build
  displayName: 'npm install and build'

- task: AzureStaticWebApp@0
  inputs:
      app_location: "apps/luis"
      api_location: ""
      output_location: "dist/apps/luis"
  env:
      azure_static_web_apps_api_token: $(deployment_token)

这是文件夹结构:

enter image description here

编辑: 我通过将应用程序位置更改为 apps/luis/src 来修复第二个错误,以便它可以找到 index.html 文件。但第一个初始错误仍然没有解决。

最佳答案

我通过将 app_location 设置为 "/" 来修复此问题

关于angular - NX Monorepo 的 Azure 静态 Web 应用程序部署管道错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72712650/

相关文章:

html - Angular 通过按 Enter 键或单击按钮提交

iis - Web.config webServer本地和远程重写规则

c# - 使用 Xamarin 自动登录 Azure 移动服务

linux - 如何将 shell 脚本部署到私有(private) Linux 虚拟机

ruby - 在 YAML 变量中包含 jekyll/liquid 模板数据?

python - 如何用 python 解析 yaml 字符串?

Angular 结合 2 个 promise 到 1 个 promise

angular - 如何在 Angular 项目中设置 mapboxgl.accessToken?

javascript - TypeError : navigator. currentLang 不是函数

node.js - Google App Engine - 指定自定义构建依赖项