Invest with Cake DeFi and get guaranteed returns from your crypto assets. Register Now
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:

Published 12 Sep 2020

Recent Posts

Angular Jira Clone Part 04 - Build an editable textbox

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

Use VSCode Like a PRO

VSCode is one of the most popular code editors, skilled use of VSCode can greatly improve our programming efficiency. This post consisted of some tips I found very helpful when working with VSCode, which I hope will help you too.

Follow @tuantrungvo on Twitter for more!