如何解决Angular 部署到 Azure 静态 Web 应用程序 - 错误 Github Action
我有一个 Azure 静态 Web 应用。我遵循了 https://github.com/Azure/static-web-apps/issues/231 中的解决方法,包括依赖项中的开发依赖项,但出现了新错误。运行GitHub Action部署时,抛出如下错误
internal/modules/cjs/loader.js:883
throw err;
^
Error: Cannot find module '/github/workspace/.oryx_prod_node_modules/decorate-angular-cli.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
at Function.Module._load (internal/modules/cjs/loader.js:725:27)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
at internal/main/run_main_module.js:17:47 {
code: 'MODULE_NOT_FOUND',requireStack: []
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! platform@0.0.0 postinstall: ngcc --properties es2015 browser module main --first-only --create-ivy-entry-points && node ./decorate-angular-cli.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the platform@0.0.0 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /github/home/.npm/_logs/2021-01-18T09_53_27_589Z-debug.log
---End of Oryx build logs---
Oryx has Failed to build the solution.`
这是 GitHub 工作流操作
name: Azure Static Web Apps CI/CD
on:
push:
branches:
- master
pull_request:
types: [ opened,synchronize,reopened,closed ]
branches:
- master
jobs:
build_and_deploy_job:
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed')
runs-on: ubuntu-latest
name: Build and Deploy Job
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Build And Deploy
id: builddeploy
uses: Azure/static-web-apps-deploy@v0.0.1-preview
with:
app_build_command: npm i --unsafe-perm && ng build --prod
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_WITTY_MUD_0EA88F703 }}
repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments)
action: "upload"
###### Repository/Build Configurations - These values can be configured to match you app requirements. ######
# For more information regarding Static Web App workflow configurations,please visit: https://aka.ms/swaworkflowconfig
app_location: "/" # App source code path
output_location: "dist/apps/admin" # Built app content directory - optional
###### End of Repository/Build Configurations ######
close_pull_request_job:
if: github.event_name == 'pull_request' && github.event.action == 'closed'
runs-on: ubuntu-latest
name: Close Pull Request Job
steps:
- name: Close Pull Request
id: closepullrequest
uses: Azure/static-web-apps-deploy@v0.0.1-preview
with:
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_WITTY_MUD_0EA88F703 }}
action: "close"
有谁知道这里的问题是什么?我正在使用 Angular 和 Nrwl Nx
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。