<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Atta Ur Rahman]]></title><description><![CDATA[Quick dives into dev problems I've actually hit — and the fixes that worked. .NET, AWS, Azure, Node.js, Angular, Windows quirks, and whatever else breaks on a r]]></description><link>https://speedytangent.hashnode.dev</link><image><url>https://cdn.hashnode.com/uploads/logos/68c399e52b2af531f96184d5/29a68155-ac93-467b-be71-2c2536a892f5.webp</url><title>Atta Ur Rahman</title><link>https://speedytangent.hashnode.dev</link></image><generator>RSS for Node</generator><lastBuildDate>Thu, 10 Sep 2026 09:54:54 GMT</lastBuildDate><atom:link href="https://speedytangent.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[How to Fix "Error: listen EADDRINUSE" Without Rebooting (Node.js on Windows 11)]]></title><description><![CDATA[. .
If you've been building and testing a Node.js server, you've probably run into this cryptic wall at least once:
Error: listen EADDRINUSE
  at errnoException (net.js:614:11)
  at Array.0 (net.js:70]]></description><link>https://speedytangent.hashnode.dev/how-to-fix-error-listen-eaddrinuse-without-rebooting-node-js-on-windows-11</link><guid isPermaLink="true">https://speedytangent.hashnode.dev/how-to-fix-error-listen-eaddrinuse-without-rebooting-node-js-on-windows-11</guid><category><![CDATA[Node.js]]></category><category><![CDATA[Angular]]></category><category><![CDATA[cli]]></category><category><![CDATA[terminal]]></category><dc:creator><![CDATA[Atta Ur Rahman]]></dc:creator><pubDate>Wed, 22 Apr 2026 12:43:14 GMT</pubDate><content:encoded><![CDATA[<p>. .</p>
<p>If you've been building and testing a Node.js server, you've probably run into this cryptic wall at least once:</p>
<pre><code class="language-plaintext">Error: listen EADDRINUSE
  at errnoException (net.js:614:11)
  at Array.0 (net.js:704:26)
  at EventEmitter._tickCallback (node.js:192:40)
</code></pre>
<p>Frustrating, right? Your server won't start, nothing seems broken in your code, and a full system reboot feels like overkill. Let's fix this properly.</p>
<hr />
<h2>What Does EADDRINUSE Actually Mean?</h2>
<p><code>EADDRINUSE</code> stands for <strong>Error: Address Already In Use</strong>. It means the port your Node.js app is trying to listen on — say, port <code>3000</code> — is already occupied by another process. This commonly happens when:</p>
<ul>
<li><p>A previous instance of your server didn't shut down cleanly (e.g., you hit Ctrl+C mid-run).</p>
</li>
<li><p>Another app is already bound to that port.</p>
</li>
<li><p>A zombie process is still holding onto the port in the background.</p>
</li>
</ul>
<hr />
<h2>The Fix: Kill the Process Occupying the Port</h2>
<p>You don't need to reboot. You just need to find and kill the process using that port.</p>
<h3>On macOS / Linux</h3>
<p>Run this single command (replace <code>3000</code> with your port number):</p>
<pre><code class="language-bash">kill -9 $(lsof -t -i:3000)
</code></pre>
<p>This uses <code>lsof</code> to look up the process ID (PID) occupying port <code>3000</code>, then immediately kills it with <code>kill -9</code>.</p>
<blockquote>
<p><strong>Source:</strong> This solution was <a href="https://beta.stackoverflow.com/questions/8553957/how-to-release-localhost-from-error-listen-eaddrinuse/49579314#49579314">originally posted on Stack Overflow</a> by Atta Ur Rahman and later refined by the community. License: <a href="https://creativecommons.org/licenses/by-sa/4.0/">CC BY-SA 4.0</a>.</p>
</blockquote>
<hr />
<h3>On Windows 11 (PowerShell / CMD)</h3>
<p>Since <code>lsof</code> is a Unix tool, Windows users need a slightly different approach.</p>
<p><strong>Step 1:</strong> Find the PID using the port:</p>
<pre><code class="language-cmd">netstat -ano | findstr :3000
</code></pre>
<p>You'll see output like:</p>
<pre><code class="language-plaintext">TCP    0.0.0.0:3000    0.0.0.0:0    LISTENING    12345
</code></pre>
<p>The last number (<code>12345</code>) is the PID.</p>
<p><strong>Step 2:</strong> Kill the process by PID:</p>
<pre><code class="language-cmd">taskkill /PID 12345 /F
</code></pre>
<hr />
<h2>After the Kill</h2>
<p>Once the port is freed, restart your Node.js server normally:</p>
<pre><code class="language-bash">node server.js
</code></pre>
<p>Or with npm:</p>
<pre><code class="language-bash">npm start
</code></pre>
<p>It should come up cleanly without the <code>EADDRINUSE</code> error.</p>
<hr />
<h2>Pro Tip: Prevent This From Happening Again</h2>
<p>Add a graceful shutdown handler in your Node.js app so the port is always released when the process exits:</p>
<pre><code class="language-javascript">process.on('SIGINT', () =&gt; {
  server.close(() =&gt; {
    console.log('Server closed. Port released.');
    process.exit(0);
  });
});
</code></pre>
<p>This way, even hitting Ctrl+C won't leave a zombie process behind.</p>
<hr />
<h2>Summary</h2>
<table>
<thead>
<tr>
<th>Platform</th>
<th>Command</th>
</tr>
</thead>
<tbody><tr>
<td>macOS / Linux</td>
<td><code>kill -9 $(lsof -t -i:3000)</code></td>
</tr>
<tr>
<td>Windows (CMD)</td>
<td>`netstat -ano</td>
</tr>
</tbody></table>
<p>No reboot needed. Just a quick port cleanup and you're back in action.</p>
<hr />
<p><em>Found this helpful? The original Stack Overflow answer is</em> <a href="https://beta.stackoverflow.com/questions/8553957/how-to-release-localhost-from-error-listen-eaddrinuse/49579314#49579314"><em>here</em></a> <em>— give it an upvote if it saved you a reboot!</em>  </p>
<p><em><strong>Graphic Summary:</strong></em>  </p>
<img src="https://cdn.hashnode.com/uploads/covers/68c399e52b2af531f96184d5/fd980d7c-1fef-439d-9fca-7c770f1fa5cd.png" alt="" style="display:block;margin:0 auto" />]]></content:encoded></item></channel></rss>