【问题标题】:npx amplify-app@latest failed to create a Base Amplify Projectnpx amplify-app@latest 未能创建 Base Amplify 项目
【发布时间】:2021-01-22 05:51:31
【问题描述】:

我正在使用以下步骤创建一个 react-app:

  1. npx create-react-app amplify-datastore --use-npm
  2. cd amplify-datastore
  3. npx amplify-app@latest #在这最后一步中,我将向您展示我在 powershell 中得到的输出:

npx: installed 117 in 15.511s ✅ Found Amplify CLI version 4.29.4 � Creating base Amplify project Note: It is recommended to run this command from the root of your app directory ? Enter a name for the environment (dev) ❌ Failed to create base Amplify Project

我已经尝试了几次,但仍然遇到同样的问题。有人有线索吗?

【问题讨论】:

    标签: reactjs npm aws-amplify npm-scripts


    【解决方案1】:

    我遇到了和你一样的问题,但是通过运行找到了成功

    amplify init
    

    在应用程序目录中。在“cd amplify-datastore”之后的情况。

    "amplify init" 将初始化一个新的 Amplify 项目。

    然后我跑了

    npx amplify-app@latest
    

    npm install aws-amplify aws-amplify-react-native @react-native-community/netinfo
    

    然后在 CLI 中,我添加了一个新的 API

    amplify add api
    

    我遵循的教程使用了与您完全相同的步骤,但没有成功,因此我求助于阅读 Amplify DataStore 手册,我想出了这些步骤。

    【讨论】:

      猜你喜欢
      • 2020-10-10
      • 2020-04-22
      • 2021-11-17
      • 1970-01-01
      • 2021-02-16
      • 2021-01-30
      • 1970-01-01
      • 1970-01-01
      • 2019-12-18
      相关资源
      最近更新 更多