How To Solve "EADDRINUSE - Address Already In Use"
Node.js
26/04/2021
If you ever run into this problem, you have 2 options:
- Run your application on a different port, or
- Terminate the existing process
Naturally, I'll be covering the latter. 😋
Find the process ID
First things first, we need to identify the process ID of the application that's occupying the port. You can do so with lsof -i :<port number>
.
Terminate the process
Terminate the process with kill -9 <PID>
.
Windows
If you're on Windows and aren't using WSL, the next best thing is to simply open up your task manager, find the process and end it.
Source from Stack Overflow