【问题标题】:firebase deploy error and fiebase.json empty filefirebase 部署错误和 fiebase.json 空文件
【发布时间】:2017-11-03 12:28:41
【问题描述】:

我正在关注这个教程Getting Started with Firebase Hosting on the Web - Firecasts

我正在尝试在 firebase 中托管一个简单的 index.html 文件,但是当我键入 firebase deploy 时,它给了我以下错误:

未找到目标。有效目标是:数据库、存储、功能、主机。 hosting error image

我发现我的 firebase.json 文件是空的,它只包含 { }

【问题讨论】:

  • 感谢 j0k 更新问题。

标签: firebase firebase-hosting


【解决方案1】:

再次运行firebase init

当您被询问时 - 您要为此文件夹设置哪些 Firebase CLI 功能?

按空格键选择特征,它会用星号标记该特征。

然后 Enter 以确认您的选择。

确保通过按空格键选择选项,然后按 Enter。

【讨论】:

  • 非常感谢 Amresh。我的错误是,我通过上下键选择该选项,然后按 Enter。
  • 我遇到了完全相同的问题。我不知道有没有使用space-bar 的选项只能上下输入!!!太混乱了。
【解决方案2】:

运行 firebase init,如果您的 firebase.json 是空的,只有 {} 然后添加

 {
  "hosting": {
    "public": "public",
    "ignore": [
      "firebase.json",
      "**/.*",
      "**/node_modules/**"
    ]
  }
}

"public": "app" 替换为 "public": "public"

然后运行 ​​firebase deploy

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-10-26
    • 2018-12-02
    • 2021-04-10
    • 2017-12-12
    • 2018-09-13
    • 2023-03-13
    相关资源
    最近更新 更多