我正在努力在本地测试我的火力基础功能。我的数据库模拟器似乎可以正常工作
✗ firebase serve --only database
i database: Emulator logging to database-debug.log
✔ database: Emulator started at http://localhost:9000
但是当我尝试一起启动所有模拟器时,它没有启动
✗ firebase emulators:start
i Starting emulators: ["functions","hosting"]
✔ functions: Using node@10 from host.
✔ functions: Emulator started at http://localhost:5001
i hosting: Serving hosting files from: dist
✔ hosting: Local server: http://localhost:5000
✔ hosting: Emulator started at http://localhost:5000
i functions: Watching ".../functions" for Cloud Functions...
⚠ functions: Your GOOGLE_APPLICATION_CREDENTIALS environment variable points to .../ignore/fbkey.json. Non-emulated services will access production using these credentials. Be careful!
✔ functions[subscribe]: http function initialized (http://localhost:5001/xxx/us-central1/subscribe).
✔ functions[unsubscribe]: http function initialized (http://localhost:5001/xxx/us-central1/unsubscribe).
i functions[sendNotification]: function ignored because the database emulator does not exist or is not running. <-------- why does this happen
✔ All emulators started, it is now safe to connect.
我得到与firebase serve
相同的结果,不知道下一步该怎么做?
较新的emulators:start
命令是启动实时数据库模拟器的推荐方法。
因此,请先运行以下命令来设置所需的模拟器:
firebase init emulators
然后运行以下命令以启动它们:
firebase emulators:start
或者,如果您只想启动某些:
firebase emulators:start --only database,functions
在撰写本文时,支持的模拟器包括:
- 实时数据库 (
database
( - 云修复 (
firestore
( - 云功能 (
functions
( - 托管 (
hosting
( - 云发布/订阅 (
pubsub
(