【发布时间】:2022-07-27 18:46:32
【问题描述】:
我用 React.js 编写了一个项目,我想在 Firebase 托管中部署它,但我收到以下错误:
错误:未能列出 Firebase 项目。有关详细信息,请参阅 firebase-debug.log。
firebase-debug.log:
[debug] [2022-06-03T14:11:04.642Z] ----------------------------------------------------------------------
[debug] [2022-06-03T14:11:04.646Z] Command: /usr/local/bin/node /usr/local/bin/firebase init
[debug] [2022-06-03T14:11:04.647Z] CLI Version: 11.0.1
[debug] [2022-06-03T14:11:04.648Z] Platform: linux
[debug] [2022-06-03T14:11:04.648Z] Node Version: v16.14.0
[debug] [2022-06-03T14:11:04.649Z] Time: Fri Jun 03 2022 10:11:04 GMT-0400 (Eastern Daylight Time)
[debug] [2022-06-03T14:11:04.649Z] ----------------------------------------------------------------------
[debug]
[debug] [2022-06-03T14:11:04.656Z] >>> [apiv2][query] GET https://firebase-public.firebaseio.com/cli.json [none]
[debug] [2022-06-03T14:11:04.697Z] > 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] [2022-06-03T14:11:04.698Z] > authorizing via signed-in user (abc.sadeghi27@gmail.com)
[info]
######## #### ######## ######## ######## ### ###### ########
## ## ## ## ## ## ## ## ## ## ##
###### ## ######## ###### ######## ######### ###### ######
## ## ## ## ## ## ## ## ## ## ##
## #### ## ## ######## ######## ## ## ###### ########
You're about to initialize a Firebase project in this directory:
/home/ali27/Desktop/Project/Resume/react-site
[info]
=== Project Setup
[info]
[info] First, let's associate this project directory with a Firebase project.
[info] You can create multiple project aliases by running firebase use --add,
[info] but for now we'll just set up a default project.
[info]
[debug] [2022-06-03T14:11:10.062Z] >>> [apiv2][query] GET https://firebase.googleapis.com/v1beta1/projects pageSize=100
[debug] [2022-06-03T14:11:11.166Z] <<< [apiv2][status] GET https://firebase.googleapis.com/v1beta1/projects 403
[debug] [2022-06-03T14:11:11.167Z] <<< [apiv2][body] GET https://firebase.googleapis.com/v1beta1/projects [omitted]
[debug] [2022-06-03T14:11:11.167Z] Unable to parse JSON: SyntaxError: Unexpected token < in JSON at position 0
[debug] [2022-06-03T14:11:11.719Z] FirebaseError: Unable to parse JSON: SyntaxError: Unexpected token < in JSON at position 0
at RetryOperation._fn (/usr/local/lib/node_modules/firebase-tools/lib/apiv2.js:258:39)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
[error]
[error] Error: Failed to list Firebase projects. See firebase-debug.log for more info.
感谢您解决了我的问题。
【问题讨论】:
-
我猜你提供的输出是“firebase init”的结果。你在那里得到 403 ......你在 init 之前运行了“firebase login”吗?你有权限吗?您使用的是哪个 Firebase 计划?
标签: reactjs firebase firebase-hosting firebase-cli