0

When I want to run my project next js in localhost I happen to have this problem in the console:

yarn run v1.22.10
$ next  dev -p 4444
Port 4444 is already in use.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

I closed the tab on the browser without stopping dev with ctrl + c.

How can I fix this ? I want to run the project again

jonrsharpe
  • 115,751
  • 26
  • 228
  • 437
Karol
  • 166
  • 1
  • 4
  • 15
  • Does this answer your question? [How do I kill the process currently using a port on localhost in Windows?](https://stackoverflow.com/questions/39632667/how-do-i-kill-the-process-currently-using-a-port-on-localhost-in-windows) – juliomalves May 29 '21 at 02:51

1 Answers1

0

Find the process using

sudo lsof -i :4444

It returns you a process id

Kill the process

kill -9 <PID>

gandharv garg
  • 1,781
  • 12
  • 17