解决 firebase cli 的 firebase login 无法登录问题

如果你执行

firebase login --no-localhost

遇到了

Error: Failed to make request to https://firebase-public.firebaseio.com/cli.json

或者使用

firebase login

遇到了

Waiting for authentication...
(node:86044) UnhandledPromiseRejectionWarning: FirebaseError: Failed to make request to https://firebase-public.firebaseio.com/cli.json
    at RetryOperation._fn (/Users/<me>/.nvm/versions/node/v14.19.1/lib/node_modules/firebase-tools/lib/apiv2.js:240:31)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:86044) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:86044) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

的话

并且你确定你配置了你的网络,已经可以访问firebase服务和谷歌服务,可是仍然无法登录的话

那是因为firebase的某写东西还是没有走你配置的网络

有2个解决方案

1.路由级配置网络

让你的网络上层就可以访问google和firebase服务

2.用Proxifier装载你本地的代理

它也可以让你的网络全局可以访问google和firebase服务

image.png

然后再firebase login就成了。

话不多,都干货