简体   繁体   中英

Firebase hosting - Unable to authorize access to project

I'm using $firebase deploy to upload my static files to my newly created firebase project, but I get the following error in the command line.

Unable to authorize access to project project-1234567890

The error message goes on to mention the Firebase CLI is only compatible with the new Firebase Console, which is what I'm using.

I've signed in earlier, so I believe I should have access to the project I've created in the console.

Try running this after you go through your firebase init

firebase use --add

From there you can select your instance, for example: your-project-name-instance

I had the same issue, and running that command and selecting the instance allowed me to do the deploy.

I solved my problem with the following steps:

  1. I removed .firebaserc.
  2. Then I again ran:

     firebase init
  3. Then I chose my default project.

Type these commands:

  1. firebase login

    Login with your email that content your Firebase project

  2. `firebase use --add

    Choose the name of your project

  3. Now type: firebase deploy

You can check firebase-debug.log In my case, the error was "FirebaseError: HTTP Error: 401, Request had invalid authentication credentials."

run the following command:-

firebase login --reauth

then you can use

firebase deploy

When I tried doing a $firebase deploy --debug my upload seemed to work. I'm not sure if this new command arg fixed the issue, or if I needed to wait a certain amount of time after creating the project before performing the deploy.

Make sure you are logged in into the right account. So use $firebase logout out and then $firebase login select the correct account and allow CLI.

Authorization issue requires you to permit the currently logged under "Project Overview --> Users and Permissions". This error means that the logged in user does not belong to any of the permitted roles for firebase database in question. You must go to firebase console and add user to a role under Users and Permissions.

I did yarn build

and add { "projects": { "default": "xxx", "staging": "yyyy" } }

to .firebaserc

not sure which one helped!

I also facing this issue and fixed now .

  1. I also facing this issue and fixed now.
  2. I tried logout, logging but any firebase command showing this same error.
  3. I confirmed my user id have full access.
  4. I tried firebase cli update npm install -g firebase-tools not worked
  5. I run CMD as run as administrator it worked for some time. But no longer ;

Finally, I fixed this issue by delete the.config folder then firebase command is working and new .config folder created

C:\Users\DELL\.config

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM