简体   繁体   English

错误:无法获取 Firebase 项目构建。 请确保该项目存在并且您的帐户有权访问它

[英]Error: Failed to get Firebase project build. Please make sure the project exists and your account has permission to access it

package json: package json:

 "scripts": { "start": "react-scripts start", "build": "react-scripts build", "build:dev": "CI=false env-cmd -f.env.local npm run build && firebase deploy -P build", "test": "react-scripts test", "eject": "react-scripts eject" },

when running npm run build:dev returns:运行 npm 时运行 build:dev 返回:

Error: Failed to get Firebase project build.错误:无法获取 Firebase 项目构建。 Please make sure the project exists and your account has permission to access it.请确保该项目存在并且您的帐户有权访问它。

firebase-debug.log: firebase-debug.log:

 [debug] [2022-01-29T23:34:29.653Z] <<< HTTP RESPONSE 200 {"date":"Sat, 29 Jan 2022 23:34:29 GMT","pragma":"no-cache","expires":"Mon, 01 Jan 1990 00:00:00 GMT","cache-control":"no-cache, no-store, max-age=0, must-revalidate","content-type":"application/json; charset=utf-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","server":"scaffolding on HTTPServer2","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","alt-svc":"h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"","accept-ranges":"none","transfer-encoding":"chunked"} [debug] [2022-01-29T23:34:29.700Z] >>> [apiv2][query] GET https://firebase.googleapis.com/v1beta1/projects/build [none] [debug] [2022-01-29T23:34:29.967Z] <<< [apiv2][status] GET https://firebase.googleapis.com/v1beta1/projects/build 403 [debug] [2022-01-29T23:34:29.967Z] <<< [apiv2][body] GET https://firebase.googleapis.com/v1beta1/projects/build {"error":{"code":403,"message":"The caller does not have permission","status":"PERMISSION_DENIED"}} [debug] [2022-01-29T23:34:29.967Z] HTTP Error: 403, The caller does not have permission [debug] [2022-01-29T23:34:30.049Z] FirebaseError: HTTP Error: 403, The caller does not have permission at module.exports (/usr/local/lib/node_modules/firebase-tools/lib/responseToError.js:38:12) at Client.doRequest (/usr/local/lib/node_modules/firebase-tools/lib/apiv2.js:241:23) at processTicksAndRejections (node:internal/process/task_queues:96:5) at async Client.request (/usr/local/lib/node_modules/firebase-tools/lib/apiv2.js:96:20) at async getFirebaseProject (/usr/local/lib/node_modules/firebase-tools/lib/management/projects.js:290:21) at async getDefaultHostingSite (/usr/local/lib/node_modules/firebase-tools/lib/getDefaultHostingSite.js:8:21) at async requireHostingSite (/usr/local/lib/node_modules/firebase-tools/lib/requireHostingSite.js:9:18) at async Object.fn (/usr/local/lib/node_modules/firebase-tools/lib/commands/deploy.js:73:9) at async /usr/local/lib/node_modules/firebase-tools/lib/command.js:188:17 [error] [error] Error: Failed to get Firebase project build. Please make sure the project exists and your account has permission to access it.

GET https://firebase.googleapis.com/v1beta1/projects/build errors inside debug:在调试中获取https://firebase.googleapis.com/v1beta1/projects/build错误:

 { error: { code: 401, message: "Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.", status: "UNAUTHENTICATED", details: [ { @type: "type.googleapis.com/google.rpc.ErrorInfo", reason: "CREDENTIALS_MISSING", domain: "googleapis.com", metadata: { method: "google.firebase.service.v1beta1.FirebaseProjectService.GetFirebaseProject", service: "firebase.googleapis.com" } } ] } }

I have tried:我努力了:

  • firebase login / logout firebase 登录/注销
  • firebase use --add firebase 使用 --add
  • firebase login --reauth firebase 登录 --reauth

still shows the same error;仍然显示相同的错误; what am I doing wrong here?我在这里做错了什么?

Run this运行这个

Try firebase login --reauth试试firebase login --reauth

What worked for me was to run firebase use <insert project alias> .对我有用的是运行firebase use <insert project alias> After running that, everything worked perfectly.运行之后,一切正常。

change fb alias in cli to project name + change将 cli 中的 fb 别名更改为项目名称 + 更改

 "build:dev": "CI=false env-cmd -f.env.local npm run build && firebase deploy -P riplir",

暂无
暂无

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

相关问题 错误:无法获取 Firebase 项目项目名称。 请确保该项目存在并且您的帐户有权访问它 - Error: Failed to get Firebase project project-name. Please make sure the project exists and your account has permission to access it Azure 管道错误:无法获取 Firebase 项目项目名称。 请确保该项目存在并且您的帐户有权访问它 - Azure Pipline Error: Failed to get Firebase project project-name. Please make sure the project exists and your account has permission to access it CircleCI Workflow 找不到 Firebase 项目:项目选择无效,请验证项目“项目”是否存在并且您有权访问 - CircleCI Workflow cannot find Firebase project: Invalid project selection please verify project 'project' exists and you have access 使用云构建部署云功能失败:错误:未能获得 firebase 项目 - deploy cloud functions using cloud build failed: Error: failed to get firebase project 如何解决“您的项目没有云服务机器人帐户。请确保为您的项目启用了 Dataflow API。” - How to fix "There is no cloudservices robot account for your project. Please ensure that the Dataflow API is enabled for your project." 我无法使用正确的详细信息验证 Firebase。 获取错误:确保使用服务帐户凭据初始化 SDK - I can't authenticate Firebase with correct details. Get error: Make sure to initialize the SDK with a service account credential “错误:禁止”即使服务帐户具有 function 权限访问 - "Error: Forbidden" even though service account has function permission access 错误:使用 firebase 登录切换帐户时无法确定 firebase 中的活动 Firebase 项目目录:使用 - Error: Could not determine active Firebase project directory in firebase while switching account with firebase login:use Firebase 登录时出现“Auth.network-request-failed”错误的项目结果 - Firebase Project Results in "Auth/network-request-failed" error on login 尝试将 Firebase 依赖项添加到 Qt 项目时生成错误 - Build error when trying to add Firebase dependency to Qt project
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM