简体   繁体   English

无法将 api 资源添加到 AWS Amplify 项目

[英]Cant add api resource to AWS Amplify project

So I have ran the following commands to initialize my amplify project:所以我运行了以下命令来初始化我的放大项目:

amplify configure
amplify init

Then i run amplify add api .然后我运行amplify add api

when I select "REST" api, it says "There was an error adding the API resource" Running amplify status confirms that nothing was added.当我 select“REST”api 时,它说“添加 API 资源时出错”运行amplify status确认没有添加任何内容。 However, when I try to add the "GraphQL" api, it gives me the same error message, but running amplify status indicates that it was actually added successfully.但是,当我尝试添加“GraphQL”api 时,它给了我相同的错误消息,但运行amplify status表明它实际上已成功添加。

i want to add REST api to my amplify app.我想将 REST api 添加到我的放大应用程序中。 Not sure what the issue is.不确定是什么问题。 I have tried updating amplify cli and reinitializing my project multiple times.我尝试多次更新 amplify cli 并重新初始化我的项目。 thanks in advance.提前致谢。

I am seeing a similar error in the step: Try opening with system-default editor instead?我在步骤中看到类似的错误:尝试使用系统默认编辑器打开?

The error is:错误是:

在此处输入图像描述

There are 2 options that helped me有 2 个选项对我有帮助

  • On this step select No关于这一步 select
  • Install xdg-utils : sudo yum -y install xdg-utils (I am using EC2 linux 2 instance)安装xdg-utils : sudo yum -y install xdg-utils (我使用的是 EC2 linux 2 实例)

Try these options and let's see if it helps you.尝试这些选项,让我们看看它是否对您有帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM