我有一个firebase云函数,它从云存储中获取数据。
const userSnapshot = await admin.firestore().collection('users').doc(user).get()使用firebase emulators:start在本地部署此接口时。
我得到以下错误:
The Cloud Firestore emulator is not running so database operations will fail with a 'default credentials' error.
⚠ Google API requested!
- URL: "https://oauth2.googleapis.com/token"
- Be careful, this may be a production service.
> Auth error:Error: invalid_grant只有在更新了firebase-tools之后才会发生这种情况。以前,它在使用firebase serve --only function --port=9000时工作得很好。在这个工具版本中,我不能通过命令行设置端口。
发布于 2019-05-11 12:30:52
在6.9.2中解决了这个问题
我们可以使用带端口号的firebase服务来访问firestore。
https://stackoverflow.com/questions/56058087
复制相似问题