我正在尝试构建一个 ionic Web 构建,通过 AppFlow 实时更新进行部署,使用 ionic-cloud cli ,运行:
ionic-cloud build web --app-id=12345678 --commit=35d97a73bf3bb7144bcc9473bcc9b6e0fb2ec500
我收到 npm 不兼容错误,因为它正在为最新的 ionic-stack 构建我的项目,而我的构建目标是早期的 2022.07 堆栈:
手动运行 ionic-cloud 构建命令时如何指定构建堆栈?
ionic-cloud build web -h
:找到
ionic-cloud build web
This command creates a web build on Appflow. While the build is running, it prints the remote build log to the terminal.
Usage:
ionic-cloud build web [flags]
Aliases:
web, live-update, web-preview
Examples:
ionic-cloud build web --app-id=a1234bc --commit=a9eb85e
ionic-cloud build web --app-id=a1234bc --commit=a9eb85e --web-preview
ionic-cloud build web-preview --app-id=b3456cd --commit=4c511f1 --environment="My Custom Environment Name"
Flags:
--app-id string Appflow app id [required]
******
--build-stack string Target platform ("Linux - 2023.10" / "Linux - 2023.06" / "Linux - 2023.04" / "Linux - 2022.10" / "Linux - 2022.07"), defaults to latest stack
******
--commit string Commit sha [required]
--detached Asynchronously run appflow build (default: false)
--env env-file Variables to expose to your build. Variables defined this way override those loaded using the env-file flag. Example: --env VAR=value
--env-file stringArray Files declaring environment variables to expose to your build. Variables from later files overwrite variables from earlier files.
--environment string The name of the predefined Appflow Environment to expose to your build
-h, --help help for web
--secret stringArray Secrets to expose to your build. Example: --secret VAR=value
--web-preview Enable web preview
--zip Download zip file
--zip-name string Download zip and rename file. Example: myapp.zip
因此使用特定的构建堆栈,运行:
ionic-cloud build web --build-stack="stack-string" --app-id=12345678 --commit=35d97a73bf3bb7144bcc9473bcc9b6e0fb2ec500
对于问题中的堆栈 2022.07,运行:
ionic-cloud build web --build-stack="Linux - 2022.07" --app-id=12345678 --commit=35d97a73bf3bb7144bcc9473bcc9b6e0fb2ec500