-1

Facing an issue in nodejs app

Error: listen EADDRINUSE: address already in use :::8000 at Server.setupListenHandle [as _listen2] (node:net:1463:16) at listenInCluster (node:net:1511:12) at Server.listen (node:net:1599:7) at Object. (/root/wa_server/app.js:209:11) at Module._compile (node:internal/modules/cjs/loader:1165:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1219:10) at Module.load (node:internal/modules/cjs/loader:1043:32) at Function.Module._load (node:internal/modules/cjs/loader:878:12) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) at node:internal/main/run_main_module:22:47 Emitted 'error' event on Server instance at: at emitErrorNT (node:net:1490:8) at processTicksAndRejections (node:internal/process/task_queues:83:21) { code: 'EADDRINUSE', errno: -98, syscall: 'listen', address: '::', port: 8000 }

sudo killall -9 node

  • 2
    Does this answer your question? [Node / Express: EADDRINUSE, Address already in use - Kill server](https://stackoverflow.com/questions/4075287/node-express-eaddrinuse-address-already-in-use-kill-server) – Mostafa Fakhraei Dec 27 '22 at 14:51

1 Answers1

0

A program in your system is already running and using your 8000 port. You have to stop or kill it first. As it appears it is most likely a NodeJS process in your case which is running somewhere (in background if not foreground). You can kill the nodejs process to release the occupied port.

ranjanistic
  • 111
  • 6
  • I tried many things to find and kill this process but only 1 process is running when i kill this my current is kill and on next start same message coming Error: listen EADDRINUSE: address already in use :::8000 i tried to change port but not success on every port same message. – Muhammad Irfan Ghori Dec 31 '22 at 08:03
  • Then more context will be needed on how the code is listening to port, or how the program is being executed, or you can try `netstat -ltnp | grep -w ':8000'` or similar commands (if linux) to check for associated process. – ranjanistic Dec 31 '22 at 09:09