Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
johna69
Product and Topic Expert
Product and Topic Expert
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 Service


 

Hopefully this saves someone else the time it took me to find the root of the issue.
3 Comments
nicoschoenteich
Developer Advocate
Developer Advocate
Yep, been there.

Another option is to define another port for the approuter via an environment variable in a default-env.json file:

{ "PORT": 5001 }

 

Best Regards, Nico
RolandKramer
Active Contributor
0 Kudos
Hello john.astill

and even more to know with Apple M1/2 and macOS Ventura - Apple M1 and real SAP Basis Support

Best Regards Roland
Aydin_Ozcan
Explorer
0 Kudos

Hello , one other option is to give the port nr to approuter with a param like below

"start": "node node_modules/@sap/approuter/approuter.js -p 5009"
Usefull when local testing and using cds bind instead of env vars .
Regards , Aydin