【发布时间】:2019-10-03 02:37:39
【问题描述】:
我正在尝试使用此处列出的指南在本地测试我的功能 https://firebase.google.com/docs/functions/local-emulator
我已经使用
安装了最新的 firebase-tools
npm install -g firebase-tools
在我的package.json 中,我确认正在运行
"firebase-admin": "^7.3.0", "firebase-functions": "^2.3.1",
当我尝试使用
运行我的函数时
firebase emulators:start
它给了我下面的输出。 我做错了什么?
Starting emulators: ["functions"]
⚠ Your requested "node" version "8" doesn't match your global version "11"
✔ functions: Emulator started at http://localhost:5001
i functions: Watching "[FUNCTIONS FOLDER PATH]" for Cloud Functions...
⚠ Default "firebase-admin" instance created!
⚠ Ignoring trigger "[FUNCTION NAME]" because the service "firebaseauth.googleapis.com" is not yet supported.
⚠ Ignoring trigger "[FUNCTION NAME]" because the Cloud Firestore emulator is not running.
⚠ Ignoring trigger "[FUNCTION NAME]" because the Cloud Firestore emulator is not running.
⚠ Ignoring trigger "[FUNCTION NAME]" because the Cloud Firestore emulator is not running.
⚠ Ignoring trigger "[FUNCTION NAME]" because the Cloud Firestore emulator is not running.
⚠ Ignoring trigger "[FUNCTION NAME]" because the Cloud Firestore emulator is not running.
⚠ Ignoring trigger "[FUNCTION NAME]" because the Cloud Firestore emulator is not running.
⚠ Ignoring trigger "[FUNCTION NAME]" because the Cloud Firestore emulator is not running.
⚠ Ignoring trigger "[FUNCTION NAME]" because the Cloud Firestore emulator is not running.
⚠ Ignoring trigger "[FUNCTION NAME]" because the Cloud Firestore emulator is not running.
⚠ Ignoring trigger "[FUNCTION NAME]" because the Cloud Firestore emulator is not running.
⚠ Ignoring trigger "[FUNCTION NAME]" because the Cloud Firestore emulator is not running.
etc.
etc.
etc.
i functions: HTTP trigger initialized at http://localhost:5001/[APP NAME]/us-central1/[FUNCTION NAME]
[2019-05-15T21:43:52.436Z] @firebase/database: FIREBASE WARNING:
{"code":"app/invalid-credential","message":"Credential implementation provided to
initializeApp() via the \"credential\" property failed to fetch a valid Google
OAuth2 access token with the following error: \"Error fetching access token: Error
while making request: getaddrinfo ENOTFOUND metadata.google.internal
metadata.google.internal:80. Error code: ENOTFOUND\"."}
【问题讨论】:
-
请限制自己在每个帖子中回答一个问题。就目前而言,您正在询问两个不相关的事情。如果您在模拟器中有看起来像错误的东西的复制步骤,请发布项目 GitHub 而不是 Stack Overflow。 github.com/firebase/firebase-tools
-
删除了“不相关的东西”,即使它是输出中显示的警告消息的一部分.....
-
而且我不知道这是否是一个错误,这就是道格提出这个问题的目的。除了
firebase emulators:start的单个命令行代码之外,没有任何复制步骤,这是指南所说的唯一要做的事情。如果 Firebase 改进了这方面的文档,那就太好了 -
复制步骤必然会说明人们可以做的一切来达到这种状态,包括显示正在使用的任何代码。最好是触发问题的最少代码量,因此人们不必尝试处理不必要的代码。与 Stack Overflow 相比,制作模拟器的工程师更可能关注 GitHub 问题。
-
我有 37 个功能在部署到云环境时可以完美运行。当使用上述指南在本地运行时,如上所示,所有错误都会被炸毁。将尝试项目github
标签: firebase google-cloud-firestore google-cloud-functions firebase-cli