Kill process on a certain port

- Posted in workflow

How to kill processes that are running on a certain port? For example, I am running shadcn but I get an error that the port is in use (“EADDRINUSE”).

How can you fix that? For example for port 4000 – list the processes (PIDs in macOS):

lsof -ti:4000 

Then kill those processes:

kill -9 $(lsof -ti:4000)

That should do the trick!

Leave a Reply

Your email address will not be published. Required fields are marked *