0

Firstly I run this command (npm ndb server.js) then a debugging chrome window appear and after this Actually, I got these error when I am trying to debug in my code and I clicked on run script after that a debugging chrome window appear then it give these wired error.

     throw er; // Unhandled 'error' event
  ^

Error: listen EADDRINUSE: address already in use :::8080
at Server.setupListenHandle [as _listen2] (net.js:1279:14)
at listenInCluster (net.js:1327:12)
at Server.listen (net.js:1414:7)
at Function.listen (C:\Users\Abhishek kumar\natours\node_modules\express\lib\application.js:618:24)
at Object.<anonymous> (C:\Users\Abhishek kumar\natours\server.js:24:5)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
Emitted 'error' event at:
at emitErrorNT (net.js:1306:8)
at process._tickCallback (internal/process/next_tick.js:63:19)
at Function.Module.runMain (internal/modules/cjs/loader.js:834:11)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)

2 Answers2

0

The error is quite explicit :

Error: listen EADDRINUSE: address already in use :::8080

means that some program is already listening on port 8080 (and you have an extra hint : the ::: says that it's listening on broadcast host using IPv6).

If you're curious what program is listening on that port, you could try to navigate to http://localhost:8080 and see what's displayed. If nothing is displayed then it's not one of your web apps. Maybe you have an HTTP proxy running on your machine (I have recently come across a malware that ran mitmproxy on target machines on port 8080 to intercept all traffic).

On Mac or Linux you can use lsof to get more information on the program listening on that port.

The command you want is :

$ sudo lsof -i :8080
marc_s
  • 675,133
  • 158
  • 1,253
  • 1,388
Ki Jéy
  • 2,201
  • 14
  • 29
0

Run this command.

killall node
Ankit Kumar Rajpoot
  • 3,495
  • 23
  • 22