Urgent.News

What's breaking now, across thousands of outlets.

Tech

Fix: 'Address Already in Use' (Kill Stuck Process on Any Port)

The Error You start your local server (Node, Python, Go, Docker) and get stopped in your tracks: Error: listen EADDRINUSE: address already in use :::3000 (or bind: address already in use :8080 ) Why It Happens An orphaned background process or crashed terminal session didn't release the TCP socket. Your operating system prevents two applications from listening on the exact same port…

When attempting to launch a local server using Node, Python, Go, or Docker, developers may encounter the error message "Error: listen EADDRINUSE: address already in use :::3000" (or "bind: address already in use :8080"). This issue arises when an orphaned background process or a crashed terminal session fails to release the TCP socket, causing the operating system to prevent two applications from listening on the same port simultaneously.

For Linux and macOS users, a quick solution is to use the one-liner command "npx kill-port 3000" (replace 3000 with the blocked port number). Alternatively, they can opt for native terminal alternatives such as using the "fuser" command or the "lsof" command followed by killing the process with "kill -9".

Windows users have a similar one-liner fix available in PowerShell: "Stop-Process -Id (Get-NetTCPConnection -LocalPort 3000) -Force". In Command Prompt, users can first find the Process ID (PID) by running "netstat -ano | findstr :3000" and then terminate the process using "taskkill /PID PID /F" (replace PID with the corresponding number).

To avoid encountering this problem frequently during development, it's recommended to install the "kill-port" package globally. With this package, developers can easily terminate any port from any terminal in just one second, ensuring a smoother workflow.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Hacktoberfest Weekend Challenge: Build for a Friend

What I Built 🧠 MindFlare: A Daily Brain Exercise App for My Mother I built MindFlare , a simple daily brain-exercise app for my mother.

  • MindFlare app created for reporter's mother
  • Uses open-source AI for personalized challenges
  • Deployed on Render, code available on GitHub

Why a ready-made ID photo failed our browser framing check

Treat head centring as a preference: clamp the crop to valid bounds, then test against the rotated image. That fixed our framing bug.

  • Browser's photo framing check had bug causing ready-made ID photos to fail.
  • Code modified to clamp crop to valid bounds and test rotated image.
  • Issue resolved by considering image content, not just position within canvas.

More from Sunday 4 October →