0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

「Error: Could not start Firestore Emulator, port taken.」のエラー対処法

Posted at

Firebase emulatorを起動しようとしたら「Error: Could not start Firestore Emulator, port taken.」というエラーがでた。

起動できない原因は前回Firebase emulatorの終了に失敗したため。
以下のxxxx番のportが開いていないので、エミュレーターを起動することができなかった

firestore: Port xxxx is not open, could not start Firestore Emulator.
Error: Could not start Firestore Emulator, port taken.

以下コマンドで任意のプロセスを終了することで、次回からemulatorが起動できる

lsof -ti:xxxx | xargs kill

覚えるのがめんどくさいのでpackage.jsonに登録しておくのもいい

"script": {
  "stop": "lsof -ti:xxxx | xargs kill"
  // 複数のポートを対象にしたい場合
  "stop2": "lsof -ti:xxxx -i :xxxx | xargs kill"
}
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?