When running multiple servers, you may encounter the error:
> Error: Address already in use > Error: listen EADDRINUSE
The error comes from trying to start a server when there’s already a running process bound to that port.
You have 2 options:
- You can start your server on a different port.
- Or you can free the current port by killing the process associated with it.
Of course, if you choose the second option, make sure it’s not running anything important.
To kill processes associated with port
# Mac $ sudo lsof -t -i tcp:8888 | xargs kill -9 # Linux $ fuser -k 8888/tcp