【问题标题】:Firebase Deploy Error: Authorization failedFirebase 部署错误:授权失败
【发布时间】:2019-04-08 09:39:02
【问题描述】:

我正在尝试以下firebase deploy 命令,但出现以下错误:

错误:授权失败。此帐户缺少以下内容 项目 ID 项目所需的权限:

  cloudfunctions.functions.create
  cloudfunctions.functions.delete
  cloudfunctions.functions.get
  cloudfunctions.functions.list
  cloudfunctions.functions.update
  cloudfunctions.operations.get
  firebase.projects.get
  firebasehosting.sites.update

我拥有所有访问权限。我正在使用角度 6。

我应该提一下,这个项目在 Firebase 的前一个项目中运行正常。我创建了一个新的,我想将前一个的内容迁移到这个新的,问题就开始了。

我还应该提到,在我与其他用户登录之前。

有什么想法吗?

【问题讨论】:

    标签: angular firebase


    【解决方案1】:

    如果您在 fireabse 网站帐户中创建了项目,则在 firebase 部署期间,我们需要选择该 firebase 项目进行托管。此外,如果您在 firebase 帐户中创建了多个项目,我们需要为部署过程选择一个项目。 为此,您需要运行以下命令。

    firebase use --add

    它将列出多个项目,您可以从该选项中选择一个。 然后运行 ​​firebase deploy。

    【讨论】:

      【解决方案2】:

      我遇到了这个问题,因为我创建并使用了 firebase use --add 的别名,然后手动将其从 .firebaserc 中删除。解决方案是运行firebase use $alias,其中$alias 是您项目的别名。例如:firebase use default

      【讨论】:

        【解决方案3】:

        按照以下步骤操作:

        firebase 项目:列表

        结果:

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

        使用命令:

        firebase 使用 chrome-epigram-510

        结果:现在使用项目 chrome-epigram-510

        使用命令

        firebase 部署

        结果
        === 部署到 '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!    
        
                                                                     
        

        托管网址:https://chrome-epigram-510.firebaseapp.com

        【讨论】:

        • 由于某种原因,firebase 在我的项目名称后附加了几个数字......也许它的名字已经在使用中
        【解决方案4】:

        我也遇到了同样的问题,但是我注销然后再次登录它现在可以正常工作了

        在命令行中注销firebase logout 再次登录输入firebase login

        【讨论】:

          【解决方案5】:

          在我的情况下,我得到了以下信息:

          > 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
          

          看起来这就是原因:我已经部署了一次,然后在将其推送到 github 之前删除了 .firebaserc 文件。然后再次尝试部署。

          通过执行firebase use --add 并选择所需的firebase 项目解决了这个问题。这再次创建了.firebaserc 文件。猜猜这里的错误信息有误导性。

          【讨论】:

            【解决方案6】:

            对我来说,这是因为有多个网站。我更改了项目名称而不是站点名称,因此没有权限。

            您的 .firebaserc 文件指向 Firebase 中的“项目”

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

            firebase.json 文件指向 Firebase 中的“站点”

            {
              "hosting": {
                "site": "my-site"
              }
            }
            

            【讨论】:

              【解决方案7】:

              这发生在我身上好几次,但总是因为我要么是

              • 登录到我雇主的 firebase 帐户,尝试部署个人应用程序
              • 登录我的个人 Firebase 帐户,尝试部署公司应用。

              【讨论】:

                猜你喜欢
                • 2017-12-08
                • 2014-10-12
                • 1970-01-01
                • 1970-01-01
                • 1970-01-01
                • 2016-01-07
                • 1970-01-01
                • 2021-04-23
                • 2021-09-07
                相关资源
                最近更新 更多