Here’s the error developers often get. I found the solution via this StackOverflow link. BUt for Windows WSL2 users, like me, the solution was this handy Linux command (below).
First, the error
Error: listen EADDRINUSE: address already in use :::4000
Then, the fix
lsof -i tcp:4000(replace 4000 with whatever port you were using)
When I did that, I got back the following:
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME node 2457 bill 23u IPv6 20672 0t0 TCP *:4000 (LISTEN)
- Last step is to kill the PID - in this case, 2457.
sudo kill 2457
- Problem fixed!