包.json:
"firebase-admin": "^8.12.1",
“firebase 功能”:“^3.7.0”,
firebase 工具:
8.4.2
平台:
视窗
firebase模拟器:开始
功能应与 Firestore 模拟器连接
! Your requested "node" version "8" doesn't match your global version "10"
i functions: Watching "D:\Workspace\a\Cloud Functions\project\functions" for Cloud Functions...
+ functions[helloWorld]: http function initialized (http://localhost:5000/[project-id]/us-central1/helloWorld).
i functions[countentitities]: function ignored because the database emulator does not exist or is not running.
@ahmadalibaloch这按预期工作。 您只运行函数模拟器,而不是数据库模拟器。
如果你想同时运行,首先运行firebase init emulators
并设置数据库模拟器,然后再次运行firebase emulators:start
。
从模拟器的 UI 我可以访问 Firestore 模拟器并对数据库进行更改,一切正常。
我用firebase init emulators
设置了模拟器,但是当我在启动模拟器后提供功能时,它给了我消息function ignored bcause the database emulator does not exist....
@ahmadalibaloch这只是没有足够的信息来调试。 请至少显示来自emulators:start
的调试日志,这些日志显示数据库模拟器正在运行但功能模拟器无法识别它。
最有用的评论
@ahmadalibaloch这按预期工作。 您只运行函数模拟器,而不是数据库模拟器。
如果你想同时运行,首先运行
firebase init emulators
并设置数据库模拟器,然后再次运行firebase emulators:start
。