在构建时放大无效的功能标志配置

Amplify Invalid feature flag configuration on build

我正在执行使用 Amplify 构建全栈应用程序的演练,我卡在第三个模块上,添加 auth。我按照 T 的所有说明进行操作,但我的构建失败,说存在像这样的无效功能标志。

                                 # Starting phase: build
2022-02-14T02:47:02.527Z [INFO]: [31mInvalid feature flag configuration[39m
2022-02-14T02:47:02.530Z [INFO]: [31mThese feature flags are defined in the "amplify/cli.json" configuration file and are unknown to the currently running Amplify CLI:[39m
                                 [31m  - project[39m
                                 [31m  - graphqltransformer.transformerversion[39m
                                 [31m  - graphqltransformer.suppressschemamigrationprompt[39m
                                 [31m  - graphqltransformer.securityenhancementnotification[39m
                                 [31m  - graphqltransformer.showfieldauthnotification[39m
                                 [31m  - auth.useenabledmfas[39m
                                 [31mThis issue likely happens when the project has been pushed with a newer version of Amplify CLI, try updating to a newer version.[39m
                                 [31mEnsure that the CI/CD pipeline is not using an older or pinned down version of Amplify CLI.[39m
                                 [31mLearn more about feature flags: https://docs.amplify.aws/cli/reference/feature-flags[39m
2022-02-14T02:47:02.539Z [ERROR]: !!! Build failed
2022-02-14T02:47:02.539Z [ERROR]: !!! Non-Zero Exit Code detected
2022-02-14T02:47:02.539Z [INFO]: # Starting environment caching...
2022-02-14T02:47:02.540Z [INFO]: # Uploading environment cache artifact...
2022-02-14T02:47:02.602Z [INFO]: # Environment caching completed
Terminating logging...

这是我的 amplify/cli.json

{
  "features": {
    "graphqltransformer": {
      "addmissingownerfields": true,
      "improvepluralization": false,
      "validatetypenamereservedwords": true,
      "useexperimentalpipelinedtransformer": true,
      "enableiterativegsiupdates": true,
      "secondarykeyasgsi": true,
      "skipoverridemutationinputtypes": true,
      "transformerversion": 2,
      "suppressschemamigrationprompt": true,
      "securityenhancementnotification": false,
      "showfieldauthnotification": false
    },
    "frontend-ios": {
      "enablexcodeintegration": true
    },
    "auth": {
      "enablecaseinsensitivity": true,
      "useinclusiveterminology": true,
      "breakcirculardependency": true,
      "forcealiasattributes": false,
      "useenabledmfas": true
    },
    "codegen": {
      "useappsyncmodelgenplugin": true,
      "usedocsgeneratorplugin": true,
      "usetypesgeneratorplugin": true,
      "cleangeneratedmodelsdirectory": true,
      "retaincasestyle": true,
      "addtimestampfields": true,
      "handlelistnullabilitytransparently": true,
      "emitauthprovider": true,
      "generateindexrules": true,
      "enabledartnullsafety": true
    },
    "appsync": {
      "generategraphqlpermissions": true
    },
    "latestregionsupport": {
      "pinpoint": 1,
      "translate": 1,
      "transcribe": 1,
      "rekognition": 1,
      "textract": 1,
      "comprehend": 1
    },
    "project": {
      "overrides": true
    }
  }
}

我将节点、aws-amplify 和 amplify 都更新到了最新版本。这里有什么问题?

这似乎是 aws 构建映像和您机器之间的不同版本的 amplify cli。

检查您的 amplify cli 版本:

$ amplify --version

并在构建映像中覆盖 amplify CLI 的版本: AWS Amplify 控制台 -> 构建设置 -> 构建映像设置 -> 实时包更新 -> Amplify CLI