How can I stop webpack dev server from windows console?

On Windows this Powershell seems to kill it (and all Node processes!)

get-process node | Stop-Process

You only need to type Ctrl+C two times


I have also been running into this hard-to-kill webpack-dev-server process on my Windows machine lately.

Ctrl+C/break and even closing were getting me nowhere and I quickly tired of manually tracking down the process and killing it.

This one-liner did the trick for me:

for /f "tokens=5" %a in ('netstat -aon ^| findstr 8080 ^| findstr LISTENING') do taskkill /pid %a /f

I went ahead and made a kill-server.bat file for it:

@echo off
for /f "tokens=5" %%a in ('netstat -aon ^| findstr %1 ^| findstr LISTENING') do taskkill /pid %%a /f && echo killed PID %%a

I put that on my PATH, so now to kill a server using a specific port I can just:

kill-server 8080

On a side note, this issue seems to happen for me only when I use console emulation tools, not when I am using the windows command prompt directly.


I run webpack devserver by issuing the "npm start" command. I've found that CTRL+C doesn't work for me and just creates an orphaned process. I'm able to kill the devserver by opening the task manager and killing any running node.exe processes.

Another way to do this from plain jane windows console is to find the node process Ids and kill them.

tasklist /FI "IMAGENAME eq node.exe"

Image Name                     PID Session Name        Session#    Mem Usage
========================= ======== ================ =========== ============
node.exe                      4620 Console                    2     44,568 K
node.exe                     12452 Console                    2    486,260 K

Then kill them with the following command.

taskkill /F /PID 4620 /PID 12452

An alternative more direct approach as pointed out by a comment.

taskkill /F /IM node.exe