尝试运行命令时 Firebase CLI 发生错误

问题描述 投票:0回答:1

我正在尝试将我的 flutter 项目连接到 firebase 数据库。我以前也这么做过很多次。但现在在这个项目中,当我想执行时它给了我这个错误

flutterfire configure --project=messanger-ddbbb
我不知道如何解决它。

FirebaseCommandException: An error occured on the Firebase CLI when attempting to run a command.
COMMAND: firebase projects:list --json 
ERROR: Failed to list Firebase projects. See firebase-debug.log for more info.

这是我的日志:

[debug] [2024-05-18T17:36:00.583Z] ----------------------------------------------------------------------
[debug] [2024-05-18T17:36:00.591Z] Command:       C:\Program Files\nodejs\node.exe C:\Users\armin\AppData\Roaming\npm\node_modules\firebase-tools\lib\bin\firebase.js projects:list --json
[debug] [2024-05-18T17:36:00.592Z] CLI Version:   13.8.3
[debug] [2024-05-18T17:36:00.592Z] Platform:      win32
[debug] [2024-05-18T17:36:00.592Z] Node Version:  v20.13.1
[debug] [2024-05-18T17:36:00.593Z] Time:          Sat May 18 2024 21:06:00 GMT+0330 (Iran Standard Time)
[debug] [2024-05-18T17:36:00.593Z] ----------------------------------------------------------------------
[debug]
[debug] [2024-05-18T17:36:00.605Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
[debug] [2024-05-18T17:36:00.607Z] > authorizing via signed-in user (<My-Email>)
[debug] [2024-05-18T17:36:00.615Z] >>> [apiv2][query] GET https://firebase.googleapis.com/v1beta1/projects pageSize=1000
[debug] [2024-05-18T17:36:01.621Z] <<< [apiv2][status] GET https://firebase.googleapis.com/v1beta1/projects 403
[debug] [2024-05-18T17:36:01.622Z] <<< [apiv2][body] GET https://firebase.googleapis.com/v1beta1/projects [omitted]
[debug] [2024-05-18T17:36:01.623Z] Unable to parse JSON: SyntaxError: Unexpected token '<', "<!DOCTYPE "... is not valid JSON
[debug] [2024-05-18T17:36:03.417Z] FirebaseError: Unable to parse JSON: SyntaxError: Unexpected token '<', "<!DOCTYPE "... is not valid JSON
    at RetryOperation._fn (C:\Users\armin\AppData\Roaming\npm\node_modules\firebase-tools\lib\apiv2.js:277:39)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
[error]
[error] Error: Failed to list Firebase projects. See firebase-debug.log for more info.

由于我所在的位置(伊朗),我正在使用 VPN

我重新安装了 Node.js 和 nvm。还有 firebase CLI。 我也尝试了很多VPN和Dnses,看起来它与我的IP无关。 我执行了所有这些 firebase 登录命令,例如:

firebase login --reauth , firebase login --debug
还有
npm install -g firebase-tools
。 但没有一个对我有用

node.js flutter firebase nvm
1个回答
0
投票

我找到了解决方案。 对于像我一样陷入不良地理位置的人,您可以使用名为:403 dns 的 dns。 这是它的网站https://403.online/download 你可以在你的电脑上设置他们的 dns,或者你可以下载他们的电脑和安卓应用程序。

© www.soinside.com 2019 - 2024. All rights reserved.