Firebase Cloud Function仿真器未启动

问题描述 投票:0回答:1

我一直在尝试使用云功能仿真器在本地测试我的云功能,但是它似乎不起作用。我跑步时会发生什么:

firebase emulators:start

我得到以下内容:

i  emulators: Starting emulators: functions
+  hub: emulator hub started at http://localhost:4400
i  emulators: Shutting down emulators.
i  hub: Stopping emulator hub

Error: An unexpected error has occurred.

Having trouble? Try again or contact support with contents of firebase-debug.log

这是我的firebase.json的样子:

{
  "functions": {
    "predeploy": [
      "npm --prefix \"$RESOURCE_DIR\" run lint"
    ]
  },
  "emulators": {}
}

我尝试运行firebase init几次,也尝试过firebase init emulators,但到目前为止都没有工作。

已登录并拥有编辑者权限的帐户。请帮助我,我非常需要这个。

firebase google-cloud-firestore google-cloud-functions google-cloud-messaging
1个回答
0
投票

我已经尝试运行过几次,运行过firebase init,也尝试过运行firebase init模拟器,但到目前为止,它们都没有起作用。

请参见https://firebase.google.com/docs/emulator-suite/install_and_configure

You will need CLI version 7.8.0 or higher to use the Emulator Sute.

首先,您能否检查您的节点版本和Firebase版本?

以下日志是本地计算机上的命令历史记录日志。

$ node -v
v10.20.1
$ firebase -V
8.2.0
$ firebase emulators:start
i  emulators: Starting emulators: firestore
i  firestore: downloading cloud-firestore-emulator-v1.11.3.jar...
Progress: ====================================================================================================> (100% of 64MB
i  firestore: Removing outdated emulator files: cloud-firestore-emulator-v1.10.2.jar
i  firestore: firestore emulator logging to firestore-debug.log
✔  firestore: firestore emulator started at http://localhost:8080
i  firestore: For testing set FIRESTORE_EMULATOR_HOST=localhost:8080
✔  emulators: All emulators started, it is now safe to connect.
.firebaserc
{}
firebase.json
{
  "firestore": {
    "rules": "firestore.rules",
    "indexes": "firestore.indexes.json"
  },
  "emulators": {
    "firestore": {
      "port": 8080
    }
  }
}
© www.soinside.com 2019 - 2024. All rights reserved.