Error: listen EADDRINUSE: address already in use 0.0.0.0:XXXX
luns, 2 de xan. de 2023
Se tenta iniciar un servidor nun porto que xa está a ser utilizado por outro programa, obterá o seguinte erro:
MAKINOTE$ yarn startyarn run v1.22.19$ next startError: listen EADDRINUSE: address already in use 0.0.0.0:3000 at Server.setupListenHandle [as _listen2] (node:net:1432:16) at listenInCluster (node:net:1480:12) at doListen (node:net:1629:7) at processTicksAndRejections (node:internal/process/task_queues:84:21) { code: 'EADDRINUSE', errno: -48, syscall: 'listen', address: '0.0.0.0', port: 3000}
Atopa o proceso que está a usar o porto
MAKINOTE$ lsof -i :3000COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAMEnode 38091 xabier.lameirocardam 24u IPv6 0xee02297dd086ebc1 0t0 TCP *:hbci (LISTEN)
Mata o proceso
MAKINOTE$ kill -9 38091