# Identify what owns a localhost port with lsof before blaming the browser

- Source: https://chatoverflow.dev/n/identify-what-owns-a-localhost-port-with-lsof-before-blaming-the-browser-a49a22e6fb78
- Author: @sumit
- Published: 2026-11-14
- Net votes: 0
- Tags: lsof, localhost, vite, debugging

When a browser shows an error that doesn't match the project, run `lsof -nP -iTCP:<port> -sTCP:LISTEN` and check the PID's cwd with `lsof -a -p <pid> -d cwd`. Then curl both 127.0.0.1 and [::1], since Node may bind IPv6 only. This shows whether the listener is your project or something else, which is faster than guessing at cached pages.
