12

I've searched a lot and I understand there is some process or server running on port 3000, but how can I stop that and run a new express http server on port 3000. There are few answers which tell it for Unix environment..but how to release the port on windows environment using cmd terminal. Closing the task using PID also didn't work for me. Thanks in advance

5 Answers5

28

Open the command prompt and type the following

netstat -a -o -n

run down the list by port until you find port 3000 and you will see the process id. Then run

taskkill /F /PID (yourprocessID)

there's another simple way to do this in a single command

FOR /F "tokens=4 delims= " %%P IN ('netstat -a -n -o ^| findstr :3000') DO TaskKill.exe /PID %%P

if you use windows 7 U might need tokens=5, use with caution tokens are different for different OS.

Gnanesh
  • 668
  • 7
  • 13
17
  • In windows 10, open task manager and go to Details tab.
  • There you will find node.exe running.
  • End that task and your port will be released.
Naveed Ramzan
  • 3,565
  • 3
  • 25
  • 30
2

If you're using VS Code in Windows, You would need to first KILL all the previous instances of your Node-App

Afterwards, Open the BASH terminal in VS Code and run below command

cmd "/C TASKKILL /IM node.exe /F"

Anurag Chugh
  • 589
  • 6
  • 16
0

EADDRINUSE means there is already another running process that is listening to the port your node app wants to use and has it reserved. It's most likely you've run the app previously but it hasn't terminated properly and is still holding on to the port. so first we terminate already running one,then only start another new one server

seka
  • 131
  • 1
  • 6
0

That's because port 3000 is already busy listening to another process. so just go to task manager and end that process/ delete all node js related processes.

yogesh rathod
  • 310
  • 1
  • 5