gpt4 book ai didi

firebase - 无法使用 exec 连接到 Firebase 模拟器套件

转载 作者:行者123 更新时间:2023-12-03 14:00:20 24 4
gpt4 key购买 nike

使用以下命令启动 firebase 项目模拟器(使用云功能和 firestore)

firebase emulators:start

它运行成功,并为我提供了连接到功能的路径,并显示了 firestore 的本地主机 URL。

然后,要执行我的笑话测试,请运行以下命令
firebase emulators:exec --only firestore jest

根据文档,要连接到本地 firstore,我们需要使用 exec。但它抛出低于错误。
i  emulators: Starting emulators: firestore
⚠ emulators: emulator hub unable to start on port 4400, starting on 4401
✔ hub: emulator hub started at http://localhost:4401
i Shutting down emulators.
i Stoppping emulator hub
⚠ Port 8080 is not open on localhost, could not start firestore emulator.
i To select a different host/port for the emulator, update your "firebase.json":
{
// ...
"emulators": {
"firestore": {
"host": "HOST",
"port": "PORT"
}
}
}
i Shutting down emulators.
Error: Could not start firestore emulator, port taken.

每次运行 exec 命令时都会抛出此错误。有人可以指出可能有什么问题吗?

编辑:来自 firebase 模拟器的日志:开始
firebase emulators:start
i emulators: Starting emulators: functions, firestore, hosting, pubsub
✔ hub: emulator hub started at http://localhost:4400
⚠ Your requested "node" version "8" doesn't match your global version "10"
✔ functions: functions emulator started at http://localhost:5001
i firestore: Serving ALL traffic (including WebChannel) on http://localhost:8080
⚠ firestore: Support for WebChannel on a separate port (8081) is DEPRECATED and will go away soon. Please use port above instead.
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
i hosting[website]: Serving hosting files from: public
✔ hosting[website]: Local server: http://localhost:5000
i hosting[admin]: Serving hosting files from: public
✔ hosting[admin]: Local server: http://localhost:5005
i hosting[b2b]: Serving hosting files from: public
✔ hosting[b2b]: Local server: http://localhost:5006
i hosting[b2c]: Serving hosting files from: public
✔ hosting[b2c]: Local server: http://localhost:5007
i hosting[sdk]: Serving hosting files from: public
✔ hosting[sdk]: Local server: http://localhost:5008
✔ hosting: hosting emulator started at http://localhost:5000
i pubsub: pubsub emulator logging to pubsub-debug.log
✔ pubsub: pubsub emulator started at http://localhost:8085

最佳答案

在您的终端中输入以下内容,其中 8080 是您的端口号:

lsof -ti tcp:8080 | xargs kill
原因: Failed quitting the previous firebase emulator

关于firebase - 无法使用 exec 连接到 Firebase 模拟器套件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60996172/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com