<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Rishabh Sharma</title>
    <description>The latest articles on DEV Community by Rishabh Sharma (@rishhbh).</description>
    <link>https://dev.to/rishhbh</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4250404%2F863e4371-0b5c-4d5c-9949-d21c707cc61b.jpg</url>
      <title>DEV Community: Rishabh Sharma</title>
      <link>https://dev.to/rishhbh</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/rishhbh"/>
    <language>en</language>
    <item>
      <title>Tired of EADDRINUSE? I Built a CLI to Deal With It</title>
      <dc:creator>Rishabh Sharma</dc:creator>
      <pubDate>Tue, 17 Nov 2026 18:20:51 +0000</pubDate>
      <link>https://dev.to/rishhbh/tired-of-eaddrinuse-i-built-a-cli-to-deal-with-it-32e7</link>
      <guid>https://dev.to/rishhbh/tired-of-eaddrinuse-i-built-a-cli-to-deal-with-it-32e7</guid>
      <description>&lt;p&gt;If you've worked with Node.js, you've probably encountered this at some point:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;Error: listen EADDRINUSE: address already &lt;span class="k"&gt;in&lt;/span&gt; use :::3000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You try to start your development server, and suddenly port 3000 is already occupied.&lt;/p&gt;

&lt;p&gt;Now begins the usual routine:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;lsof -i :3000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Find the PID.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;kill&lt;/span&gt; -9 &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;PID&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then try starting your server again.&lt;/p&gt;

&lt;p&gt;It's not exactly difficult, but having to repeat these steps gets annoying, especially when you're switching between projects or running multiple development servers.&lt;/p&gt;

&lt;p&gt;So I built &lt;strong&gt;Purgeport&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Purgeport?
&lt;/h2&gt;

&lt;p&gt;Purgeport is a cross-platform CLI that helps you find and terminate processes occupying specific ports.&lt;/p&gt;

&lt;p&gt;Instead of manually looking up PIDs and killing processes, you can simply run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx purgeport 3000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It identifies the process using the port, displays relevant process information, and lets you decide whether to terminate it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Features
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Find processes occupying specified ports.&lt;/li&gt;
&lt;li&gt;Display process information before termination.&lt;/li&gt;
&lt;li&gt;Interactive confirmation before killing processes.&lt;/li&gt;
&lt;li&gt;Support for multiple ports.&lt;/li&gt;
&lt;li&gt;Cross-platform support.&lt;/li&gt;
&lt;li&gt;Simple CLI interface.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Installation
&lt;/h2&gt;

&lt;p&gt;Install it globally using npm:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm install -g purgeport
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or run it directly with npx:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx purgeport 3000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can also pass multiple ports:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;purgeport 3000 5173 8080
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Why build another CLI for this?
&lt;/h2&gt;

&lt;p&gt;There are already tools that solve this problem.&lt;/p&gt;

&lt;p&gt;I wasn't trying to reinvent process management. I just wanted a small utility that makes this particular workflow less tedious, without remembering different commands or manually searching for process IDs.&lt;/p&gt;

&lt;p&gt;Sometimes a small developer utility is all you need.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it out
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;npm:&lt;/strong&gt; - &lt;strong&gt;npm:&lt;/strong&gt; &lt;a href="https://www.npmjs.com/package/purgeport" rel="noopener noreferrer"&gt;https://www.npmjs.com/package/purgeport&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GitHub:&lt;/strong&gt; &lt;a href="https://github.com/rishhbh/purgeport" rel="noopener noreferrer"&gt;https://github.com/rishhbh/purgeport&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Purgeport has already crossed 1,000+ npm downloads, which is pretty exciting for a small utility I built.&lt;/p&gt;

&lt;p&gt;If you try it, feedback, bug reports, and contributions are welcome.&lt;/p&gt;

&lt;p&gt;And hopefully, the next time you encounter &lt;code&gt;EADDRINUSE&lt;/code&gt;, you won't have to go hunting for PIDs manually.&lt;/p&gt;

</description>
      <category>node</category>
      <category>javascript</category>
      <category>opensource</category>
      <category>cli</category>
    </item>
  </channel>
</rss>
