Ionic 无法登录请求:POST https://api.ionic.io/login 该电子邮件未找到用户 [英] Ionic can't login Request: POST https://api.ionic.io/login No user found by that email

查看:41
本文介绍了Ionic 无法登录请求:POST https://api.ionic.io/login 该电子邮件未找到用户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试运行任何需要登录的 Ionic CLI 命令时,我收到 404 错误.

When I try to run any Ionic CLI commands that require login I get a 404 error.

这是命令行....

? Password: [hidden]
Request: POST https://api.ionic.io/login
Response: 404
Body: 
{ link: null,
  message: 'No user found by that email',
  type: 'NotFound' }

我肯定输入了正确的帐户详细信息,以确保这一点我什至在 https://dashboard 创建了几个新帐户.ionicjs.com/signup,确保我已经验证了电子邮件地址,但仍然出现相同的错误.

I am definitely entering the correct account details, to ensure this I even created several new accounts at https://dashboard.ionicjs.com/signup, ensured I had validated the email address but still the same error.

(我刚刚在这个问题上浪费了 8 个小时,所以在这里发布问答以帮助其他人.)

推荐答案

此错误是由于 Ionic 正在过渡到Ionic Pro"并且 CLI 需要使用正确的 API.它试图将登录请求发布到 api.ionic.io/login 的事实表明它正在尝试使用旧的遗留系统.您可以通过在配置中设置 backend 值来配置它使用的系统.

This error is due to the fact that Ionic are transitioning to "Ionic Pro" and the CLI needs to use the correct API. The fact that it is attempting to post login requests to api.ionic.io/login shows it's trying to use the old legacy system. You configure which system it uses by setting the backend value in the config.

修复:

首先,确保您的 Ionic CLI 是最新的.

Firstly, make sure your Ionic CLI is bang up-to-date.

检查版本:

ionic cli -v

在撰写本文时应该是 3.9.2.如果没有更新它:

It should be 3.9.2 at time of writing. If not update it:

npm install -g ionic@latest 

现在你已经有了最新的 CLI,你需要告诉它使用pro"而不是传统:

Now you've got the latest CLI you need to tell it to use "pro" not legacy:

ionic config set backend pro -g

注意:当我在我的机器上执行此操作时,它起初不起作用,并且仍然出现相同的找不到用户"错误.实际上,我必须先将 backend 切换到legacy"(使用相同的命令),然后再切换回pro".我不知道为什么这修复了它,但确实如此.

NOTE: When I did this on my machine it did not work at first and I still got the same "No user found" error. I actually had to switch the backend to "legacy" first (using that same command) and then back to "pro". I have no idea why this fixed it but it did.

这篇关于Ionic 无法登录请求:POST https://api.ionic.io/login 该电子邮件未找到用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆