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 Answers
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.
-
1
-
I was able to 'netstat -a -o -n' to determine the PID but the taskkill errored out because of '/F' flag. Nov 17, 2017 at 3:15
-
I found this tweaks.com/windows/39559/kill-processes-from-command-prompt article that was very helpful. Nov 17, 2017 at 3:41
-
@user752746 - try this on command prompt: taskkill /pid PIDNO /f stackoverflow.com/questions/8553957/…– veritasMay 2, 2022 at 13:28
- 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.
-
-
1
-
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"
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
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.