Firebase Deploy Error: Authorization failed

前端 未结 7 1398
别跟我提以往
别跟我提以往 2021-02-05 00:51

I am trying the following firebase deploy command and I get the following error:

Error: Authorization failed. This account is missing the fol

相关标签:
7条回答
  • 2021-02-05 01:27

    in my case I was getting the following:

    > firebase deploy
    
    
    Error: Authorization failed. This account is missing the following required permissions on project deploy:
    
      firebase.projects.get
      firebasehosting.sites.update
    npm ERR! code ELIFECYCLE
    npm ERR! errno 1
    npm ERR! n00001@0.0.0 deploy: `firebase deploy`
    npm ERR! Exit status 1
    npm ERR! 
    npm ERR! Failed at the n00001@0.0.0 deploy script.
    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
    
    npm ERR! A complete log of this run can be found in:
    npm ERR!     /home/beeeep/.npm/_logs/2099-98-95T09_97_94_392Z-debug.log
    

    Looks like this was the reason: I had deployed it once, then removed the .firebaserc file before pushing it to github. Then tried again to deploy.

    Resolved it by doing a firebase use --add and selecting the desired firebase project. Which created the .firebaserc file again. Guess the error message is misleading here.

    0 讨论(0)
  • 2021-02-05 01:29

    I was also facing same issue but I logged out and then logeed in again its working fine now

    to logout in command line firebase logout to login again type firebase login

    0 讨论(0)
  • 2021-02-05 01:31

    This happened to me several times, but it was always because I was either

    • logged in to my employer's firebase account, trying to deploy a personal app
    • logged into my personal firebase account, trying to deploy a company app.
    0 讨论(0)
  • 2021-02-05 01:35

    For me, this was due to having multiple sites. I changed the project name rather than the site name and therefor didn't have permissions.

    Your .firebaserc file points to the "project" within Firebase.

    {
      "projects": {
        "default": "my-project"
      }
    }
    

    While the firebase.json file points to the "site" within Firebase.

    {
      "hosting": {
        "site": "my-site"
      }
    }
    
    0 讨论(0)
  • 2021-02-05 01:37

    If you created your project in the fireabse website account, during firebase deployment we need to select that firebase project for hosting. Also if you created more than one project in the firebase account, we need to select one project for the deployment process. For that you need to run the below command.

    firebase use --add

    It will list multiple project and you can choose one from that option. Then run firebase deploy.

    0 讨论(0)
  • 2021-02-05 01:37

    Follow the next steps :

    firebase projects:list

    Result :

    ┌──────┬───────────────────────┬─────────────┐
    │ Name │ Project ID / Instance │ Permissions │
    ├──────┼───────────────────────┼─────────────┤
    │ itest │ chrome-epigram-510    │ O       │
    └──────┴───────────────────────┴─────────────┘

    Use command :

    firebase use chrome-epigram-510

    Result : Now using project chrome-epigram-510

    Use command

    firebase deploy

    Result
    === Deploying to 'chrome-epigram-510'...

    i  deploying hosting                                                                     
    i  hosting[chrome-epigram-510]: beginning deploy...                                      
    i  hosting[chrome-epigram-510]: found 9 files in dist/icrm                               
    +  hosting[chrome-epigram-510]: file upload complete                                     
    i  hosting[chrome-epigram-510]: finalizing version...                                    
    +  hosting[chrome-epigram-510]: version finalized                                        
    i  hosting[chrome-epigram-510]: releasing new version...                                 
    +  hosting[chrome-epigram-510]: release complete                                         
                                                                                             
    +  Deploy complete!    
    
                                                                 
    

    Hosting URL: https://chrome-epigram-510.firebaseapp.com

    0 讨论(0)
提交回复
热议问题