firebase emulators:start
を打った時に出たエラー
エラー内容
⚠ hosting: Port 5000 is not open on localhost, could not start Hosting Emulator.
⚠ hosting: To select a different host/port, specify that host/port in a firebase.json config file:
{
// ...
"emulators": {
"hosting": {
"host": "HOST",
"port": "PORT"
}
}
}
i emulators: Shutting down emulators.
portの5000番が使われているらしい。
記憶にないけどチェック。
確かに使われているけどcommplex-mainってなんだ?
$ lsof -i :5000
# ---------------------------------------->
COMMAND PID FD TYPE SIZE/OFF NODE NAME
ControlCe 397 21u IPv4 0t0 TCP *:commplex-main (LISTEN)
ControlCe 397 22u IPv6 0t0 TCP *:commplex-main (LISTEN)
解決
MacをMontereyにバージョンアップした時にAirPlayなる機能が5000番ポートを使っているらしい。
参考:MacをMontereyにアップデートしたらFlaskが5000番ポートで起動できなくなった
何かと5000番使うこと多いので、出くわすことが多そう?
firebaseのエミュレータ自体は5002番にして使えるようになりました!
firebase.json
"emulators": {
"hosting": {
"port": 5002
},
}