1
0

More than 3 years have passed since last update.

Gatsbyで「error Looks like develop for this site is already running, can you visit http://localhost:8000 ? If it is not, try again in five seconds!」での対処

Last updated at Posted at 2020-10-31

事例

gatsby developを実行すると以下が表示された

error Looks like develop for this site is already running, can you visit http://localhost:8000 ? If it is not, try again in five seconds!

http://localhost:8000
を調べても何も表示されないし5秒まっても再び実行しても同じエラー

何回かgatsby developを実行した際に

Something is already running at port 8000
✔ Would you like to run the app at another port instead? … yes

とか出てたので他のポートで実行されているのかと思い
http://localhost:8001
http://localhost:8002
を確認して見たが何も表示されない

解決方法

localhostを使用しているnodeのプロセスをkillする。

 $lsof -i | grep node
node    15390 user   18u  IPv6 182160      0t0  TCP *:50402 (LISTEN)
node    15404 user   20u  IPv6 182176      0t0  TCP *:33269 (LISTEN)
node    18498 user   42u  IPv4 225478      0t0  TCP localhost:8000 (LISTEN)
node    18984 user   42u  IPv4 225478      0t0  TCP localhost:8002 (LISTEN)
node    18938 user   42u  IPv4 225478      0t0  TCP localhost:8001 (LISTEN)
node    18938 user   44u  IPv6 223182      0t0  TCP *:38749 (LISTEN)
node    18951 user   18u  IPv6 223200      0t0  TCP *:50400 (LISTEN)
node    18958 user   25u  IPv4 224178      0t0  TCP localhost:34455 (LISTEN)
node    18965 user   20u  IPv6 223192      0t0  TCP *:42389 (LISTEN)

プロセスをkillする

$kill -9 18498
$kill -9 18984
$kill -9 18938

環境

  • gatsby: 2.24.85
  • ubuntu: 20.04.1 LTS
  • node: 14.2.0

参考

1
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
1
0