我正在尝试将运行在物理设备上的颤振应用程序与本地计算机上的firebase模拟器连接起来,在此索夫中遵循以下步骤来实现此目的,但在运行以下命令时
firebase emulators:start --inspect-functions --export-on-exit ./test_data/ --import ./test_data/在firebase.json中使用此配置
{
"functions": {
"predeploy": [
"npm --prefix \"$RESOURCE_DIR\" run build"
],
"source": "functions"
},
"firestore": {
"rules": "firestore.rules",
"indexes": "firestore.indexes.json"
},
"storage": {
"rules": "storage.rules"
},
"emulators": {
"auth": {
"host": "0.0.0.0",
"port": 9099
},
"functions": {
"host": "0.0.0.0",
"port": 5001
},
"firestore": {
"host": "0.0.0.0",
"port": 8080
},
"storage": {
"host": "0.0.0.0",
"port": 9199
},
"ui": {
"enabled": true
}
}
}它的结果是:
i emulators: Starting emulators: auth, functions, firestore, storage
⚠ functions: You are running the functions emulator in debug mode (port=9229). This means that functions will execute in sequence rather than in parallel.
⚠ functions: The following emulators are not running, calls to these services from the Functions emulator will affect production: database, hosting, pubsub
✔ functions: Using node@14 from local cache.
i emulators: Shutting down emulators.
i functions: Stopping Functions Emulator
i hub: Stopping emulator hub
⚠ firestore: Port 8080 is not open on 0.0.0.0, could not start Firestore Emulator.
⚠ firestore: To select a different host/port, specify that host/port in a firebase.json config file:
{
// ...
"emulators": {
"firestore": {
"host": "HOST",
"port": "PORT"
}
}
}
i emulators: Shutting down emulators.这个错误是:
错误:无法启动修复模拟器,端口已被占用。
明显解
杀死任何使用端口8080的应用程序,更有可能是来自这个索夫的透水会话的防火墙仿真器。在关闭应用程序并再次运行命令之后,也会发生同样的错误。
备注
即使在本地网络中使用我的计算机地址而不是0.0.0.0,也无法工作,并导致相同的输出。
发布于 2021-09-18 11:15:07
为了运行命令,我不得不使用另一个端口,如8000,而不是8080,用于firebase.json中的firestor条目。
firebase emulators:start --inspect-functions --export-on-exit ./test_data/ --import ./test_data/摘自这个github问题。此外,使用0.0.0.0将使firebase模拟器使用本地主机或本地网络中机器的ip地址。
尽管lsof -i :8080没有返回任何指示应用程序使用端口8080的结果
发布于 2021-09-12 16:10:11
我建议从"host": "0.0.0.0",中删除: firestore.json。[消]火基文件
这个命令帮助我杀死了运行在端口8080上的应用程序:
lsof -ti tcp:8080 | xargs kill
https://stackoverflow.com/questions/69152738
复制相似问题