2
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 1 year has passed since last update.

使いたいポートが既に使用されている場合の犯人探しと対処法

Posted at

まず結論

以下のコマンドを実行すればOK ※実行環境はUbuntu(Linux)です

lsof -i:<対象のポート>
# ex.)
lsof -i:4324

# 実行結果
COMMAND   PID    USER   FD   TYPE   DEVICE SIZE/OFF NODE NAME
node    19053 user   24u  IPv4 61691518      0t0  TCP localhost:4324 (LISTEN)

# プロセスを削除
kill 19053

発生した経緯

開発中にNode.js(nodemon経由)のアプリがバックグラウンドで実行されてしまった。

気がつかずに新たにNode.jsのアプリを実行したところ、以下のエラーが発生

Starting inspector on 127.0.0.1:4324 failed: address already in use

割とやってしまうのでメモとして残します。

2
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
2
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?