Quick way to fix the Port is Already in Use Error

Full Stack Developer | Freelancer | JavaScript | React | Nodejs.
Loves sharing knowledge through technical articles.
Dev.to: https://dev.to/myogeshchavan97
https://linktr.ee/myogeshchavan97
Search for a command to run...

Full Stack Developer | Freelancer | JavaScript | React | Nodejs.
Loves sharing knowledge through technical articles.
Dev.to: https://dev.to/myogeshchavan97
https://linktr.ee/myogeshchavan97
No comments yet. Be the first to comment.
In this tutorial, you will build a Task Management App using Next.js 16 and Prisma 7 from scratch. By creating this app, you will learn: How to set up Prisma 7 with the new Rust-free architecture How to configure a database with Prisma's driver ada...

If you're a React/Next.js developer who diligently updated your packages last week after the critical React2Shell vulnerability (CVE-2025-55182), I have some frustrating news: you need to update again. Security researchers, while probing the patches ...

Is your React app dragging its feet, but you can’t pinpoint the cause? You might think you’re following the best practices, but some common development patterns are actually degrading your app’s performance behind the scenes. In this article, we’ll u...

How to Use Separate SSH Keys for Company and Personal GitHub Accounts Managing multiple GitHub accounts is a common challenge for developers who juggle both personal and professional projects. It becomes even more complex when you want to use differe...

Have you ever built a React app only to realize that users from different countries can't use it effectively because it only supports English? In this tutorial, you'll learn how to build truly global React application using internationalization (i18n...

Have you ever struggled with the the port is already in use error while starting the application?
A lot of times when we are using multiple applications or forget to stop the previous process, we get the the port is already in use error.
Then we try to find the process using that port and then kill it or maybe restart the machine.
There is an easier way to do it. Just execute the following command in the terminal:
npx kill-port port_number
and the process using that port will be killed.
For example,
npx kill-port 3000
will kill the process using port 3000.
To kill multiple ports pass the ports separated by space
npx kill-port 3000 5000 7000
kill-port in an npm package which helps in killing any specified port or multiple ports at once.
If you want, you can install the kill-port npm package on your machine by running the following command:
npm install -g kill-port
Mac/Linux users may need to add
sudoin front of it like this:sudo npm install -g kill-port.
Once installed, you can just execute the kill-port 3000 to kill the process using port 3000.
Starting with ES6, there are many useful additions to JavaScript like
You can learn everything about all the ES6+ features in detail in my Mastering Modern JavaScript book.
Check out free preview contents of the book here.
Also, you can check out my free Introduction to React Router course to learn React Router from scratch.
Want to stay up to date with regular content regarding JavaScript, React, Node.js? Follow me on LinkedIn.