All Articles

How to kill the process currently using a given port on Windows

Sometimes when I tried running my Angular application and saw this message.

An unhandled exception occurred: Port 4200 is already in use. Use ‘—port’ to specify a different port.

How to kill the process running on given port on Windows

To simple kill the process that is running on a specific port, run this command:

npx kill-port 4200

Where 4200 is the port that needs to be stopped.

And the result is satisfying.

How to kill the process running on given port on Windows

You must have [email protected]^ version to run npx, which means as the minimum of npm running on your machine must be 5.2.0 or greater.

You can also read more about kill-port here: https://www.npmjs.com/package/kill-port

Published 12 Sep 2020

Recent Posts

Angular Jira Clone Part 03 - Setup Akita state management

My third tutorial will go further into the application state management with Akita

Angular Jira Clone Part 04 - Build an editable textbox

My fourth tutorial will focus on the first custom UI element - editable textbox


Follow @tuantrungvo on Twitter for more!