【问题标题】:Start Firebase Emulators for Firestore / Realtime Database?为 Firestore / 实时数据库启动 Firebase 模拟器?
【发布时间】:2022-07-19 06:03:12
【问题描述】:

我尝试通过个人项目和位于此处的 Firebase Emulator Suite Codelab 启动 firebase firestore 和实时数据库模拟器: (https://firebase.google.com/codelabs/firebase-emulator#0) 使用 codelab,命令行在 'firebase emulators:start' 之后打印以下内容

[....] codelab-initial-state % firebase emulators:start --import=./seed
i  emulators: Starting emulators: auth, functions, firestore, hosting
⚠  functions: The following emulators are not running, calls to these services from the Functions emulator will affect production: database, pubsub, storage
⚠  Your requested "node" version "10" doesn't match your global version "17". Using node@17 from host.
i  firestore: Importing data from /Users/lucasfrench/Documents/emulators-codelab/codelab-initial-state/seed/firestore_export/firestore_export.overall_export_metadata
i  firestore: downloading cloud-firestore-emulator-v1.13.1.jar...
Progress: =====================================================================================================================================================================> (100% of 61MB)
i  firestore: Firestore Emulator logging to firestore-debug.log
i  emulators: Shutting down emulators.
i  functions: Stopping Functions Emulator
i  firestore: Stopping Firestore Emulator
i  hub: Stopping emulator hub

Error: TIMEOUT: Port 8080 on localhost was not active within 60000ms

这与我使用实时数据库模拟器的个人项目相同。但是,我在启动其他产品的模拟器(例如身份验证模拟器)或访问 UI 模拟器时没有任何问题。

【问题讨论】:

    标签: firebase-tools


    【解决方案1】:

    这可能与this issue 有关。解决方法是指定您的本地主机地址(例如127.0.0.1)而不是localhost,并在您的firebase.json 中添加一个主机属性,其中也包含127.0.0.1。

    https://github.com/firebase/firebase-tools/issues/2379#issuecomment-972852609

    "firestore": {
        "port": 8080,
        "host": "127.0.0.1"
    },
    

    【讨论】:

      猜你喜欢
      • 2020-01-28
      • 2021-01-23
      • 1970-01-01
      • 2021-10-19
      • 1970-01-01
      • 2019-08-07
      • 1970-01-01
      • 1970-01-01
      • 2020-12-05
      相关资源
      最近更新 更多