首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Firebase模拟器UI需要一个项目ID才能启动

Firebase模拟器UI需要一个项目ID才能启动
EN

Stack Overflow用户
提问于 2021-11-17 05:47:55
回答 1查看 1.1K关注 0票数 4

我已经运行了文档,无法让UI防火墙模拟器工作。

我在mac M1上使用firebase版本: 9.22.0

控制台中的警告。

代码语言:javascript
复制
i  emulators: Starting emulators: hosting
i  hosting: Serving hosting files from: build
✔  hosting: Local server: http://localhost:5001
⚠  emulators: The Emulator UI requires a project ID to start. Configure your default project with 'firebase use' or pass the --project flag.

┌─────────────────────────────────────────────────────────────┐
│ ✔  All emulators ready! It is now safe to connect your app. │
└─────────────────────────────────────────────────────────────┘

┌──────────┬────────────────┐
│ Emulator │ Host:Port      │
├──────────┼────────────────┤
│ Hosting  │ localhost:5001 │
└──────────┴────────────────┘
  Emulator Hub running at localhost:4400
  Other reserved ports: None

我试过使用-项目我的项目,但它仍然不起作用。

Firebase.json

代码语言:javascript
复制
{
  "hosting": {
    "public": "build",
    "ignore": [
      "firebase.json",
      "**/.*",
      "**/node_modules/**"
    ],
    "rewrites": [
      {
        "source": "**",
        "destination": "/index.html"
      }
    ]
  },
  "emulators": {
    "hosting": {
      "port": 5001
    },
    "ui": {
      "enabled": true,
      "host": "localhost",
      "port": 4000
    }
  }
}

我已经确定我的模拟器是安装好的:firebase init emulators

有人能帮上忙吗?我快疯了。

EN

回答 1

Stack Overflow用户

发布于 2021-11-17 18:34:51

我遇到了同样的问题。我不知道它到底采取了什么步骤来解决,因为它花了几次尝试使它为我工作。最后,我执行了以下操作来解决这个问题

  • 更新Firebase-工具到最新版本的npm i -g firebase-tools (我最初运行的是v9.9.0)
  • 删除我的firebase.json.firebaserc文件。再次运行dependency.
  • Install以设置项目
  • ,在尝试启动这里记录的模拟器时遇到错误,编辑firebase-tools/package.json文件,并使用npm install
  • Run (再次使用模拟器

)更改全局安装的"cli-table": "https://github.com/phess101/cli-table.git" firebase-tools依赖项

我向cli-table项目提交了一个拉请求,希望它能很快被审查和发布。看起来他们最近刚刚发布了一个版本,并破坏了firebase-tools代码https://github.com/Automattic/cli-table/pull/154的这一部分。

票数 4
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/69999471

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档