EADDRINUSE 5000 – UI5 Tools on MacOS Monterey

Often you think a task will take 5 minutes, say for example cloning a colleagues repo and running it locally, often reality thinks differently.

After installing the dependencies I assumed I could jump right in and test:

npm start

<RealityJoinsTheChat>

 at Server.emit (events.js:412:35)
at emitErrorNT (net.js:1358:8)
at processTicksAndRejections (internal/process/task_queues.js:82:21) {
code: 'EADDRINUSE',
errno: -48,
syscall: 'listen',
address: '::',
port: 5000
}

</RealityJoinsTheChat>

When running UI5 locally approuter defaults to port 5000, this is typically an unbound port. However on MacOS Monterey:

lsof -nP +c 15 | grep LISTEN …

ControlCenter 731 i804190 35u IPv4 0x9387225c821a7f85 0t0 TCP *:7000 (LISTEN)
ControlCenter 731 i804190 36u IPv6 0x93872257b9d7d77d 0t0 TCP *:7000 (LISTEN)
ControlCenter 731 i804190 37u IPv4 0x9387225c821a6a35 0t0 TCP *:5000 (LISTEN)
ControlCenter 731 i804190 38u IPv6 0x93872257b9d7de7d 0t0 TCP *:5000 (LISTEN)

The feature using port 5000 is part of AirPlay. For me the solution was simply to disable AirPlay in sharing.

Sharing%20Service

Sharing Service

Hopefully this saves someone else the time it took me to find the root of the issue.