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

1
  • end the 'node' task from task manager
    – Mukul Jain
    Jan 18, 2017 at 10:38

5 Answers 5

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.

4
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.
3
  • I was able to remove the node task with this method. thanks!
    – user752746
    Nov 17, 2017 at 3:16
  • 1
    Best answer I could have been found Oct 20, 2018 at 12:58
  • This is what ultimately did it for me.
    – doriansm
    Jan 17, 2020 at 19:38
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"

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

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.

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.