【问题标题】:firebase deploy Hangs in Terminalfirebase deploy 在终端中挂起
【发布时间】:2017-08-10 22:06:30
【问题描述】:

我正在尝试将项目上传到 Firebase 托管。我最近重新安装了 macOS Sierra,所以重新安装了 Node 和 firebase-tools。

但是,在运行firebase deploy --debug 时出现以下错误

[2017-08-10T21:54:40.043Z] --------------------------------------------
--------------------------
[2017-08-10T21:54:40.046Z] Command:       
/usr/local/bin/node/usr/local/bin/firebase deploy --debug
[2017-08-10T21:54:40.047Z] CLI Version:   3.9.2
[2017-08-10T21:54:40.047Z] Platform:      darwin
[2017-08-10T21:54:40.047Z] Node Version:  v8.3.0
[2017-08-10T21:54:40.048Z] Time:          Thu Aug 10 2017 16:54:40 GMT-
0500 (CDT)
[2017-08-10T21:54:40.048Z] --------------------------------------------
--------------------------

[2017-08-10T21:54:40.058Z] > command requires scope:["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform”][2017-08-10T21:54:40.059Z] > authorizing via signed-in user
[2017-08-10T21:54:40.061Z] >>> HTTP REQUEST GET https://admin.firebase.com/v1/projects/dornfeld-design  
 Thu Aug 10 2017 16:54:40 GMT-0500 (CDT)
[2017-08-10T21:54:40.471Z] <<< HTTP RESPONSE 200 server=nginx, date=Thu, 10 Aug 2017 21:54:40 GMT, content-type=application/json; charset=utf-8, content-length=121, connection=close, x-content-type-options=nosniff, strict-transport-security=max-age=31536000; includeSubdomains, cache-control=no-cache, no-store
[2017-08-10T21:54:40.472Z] >>> HTTP REQUEST GET https://admin.firebase.com/v1/database/name-of-project/tokens  
 Thu Aug 10 2017 16:54:40 GMT-0500 (CDT)
[2017-08-10T21:54:41.061Z] <<< HTTP RESPONSE 200 server=nginx, date=Thu, 10 Aug 2017 21:54:40 GMT, content-type=application/json; charset=utf-8, content-length=429, connection=close, x-content-type-options=nosniff, strict-transport-security=max-age=31536000; includeSubdomains, cache-control=no-cache, no-store

继续前进的最佳方式是什么?我尝试使用 3 个不同版本的 Node 重新安装 firebase-tools

其他 cmets:

  1. 必须使用--unsafe-perm 命令安装firebase-tools 才能安装它。
  2. firebase init 仅创建了 .firebaserc 文件和带有 {}firebase.json 文件
  3. 手动创建firebase.json 文件和适当的公用文件夹等。

【问题讨论】:

  • 你试过firebase login
  • 是的,我在每次安装尝试后退出并重新登录。
  • 您在代理或公司防火墙后面吗?
  • 不,再次尝试使用 Yarn 而不是 Node 并且进程大部分都在工作。现在可以成功部署网站了。
  • 谢谢大家的建议。 ??????????

标签: macos firebase terminal macos-sierra firebase-tools


【解决方案1】:

解决问题的步骤

  1. 卸载节点cd /usr/local/lib sudo rm -rf node_modules

  2. 安装 Homebrew /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

  3. 安装 Yarn brew install yarn

  4. 安装 Firebase CLI yarn add firebase-tools

  5. 转到项目文件夹,firebase loginfirebase init
    一种。 init 正确创建 .firebaserc 文件
    湾。 firebase.json 仍为空白,即{}

  6. 手动创建firebase.json

    {
      "hosting": {
        "public": "build/unbundled",
        "ignore": [
          "firebase.json",
          "**/.*",
          "**/node_modules/**"
        ],
        "rewrites": [{
        "source": "**",
        "destination": "/index.html"
        }]
      }
    }
    
  7. firebase deploy 现在可以正常工作了。

【讨论】:

  • 必须使用 Node 而不是 Yarn 安装 polymer-cli 才能使其正常工作。
猜你喜欢
  • 2012-11-13
  • 2016-11-15
  • 2013-07-09
  • 1970-01-01
  • 2022-06-16
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-08-05
相关资源
最近更新 更多