Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Listen EADDRINUSE error while debugging in sails

I am trying to debug my code using node-inspector but I am getting this error in my Terminal window again and again

$ sudo sails debug
info: Running app in debug mode...
info: You probably want to install / run node-inspector to help with debugging!
info: https://github.com/node-inspector/node-inspector

info: ( to exit, type <CTRL>+<C> )

    Error: listen EADDRINUSE
        at exports._errnoException (util.js:746:11)
        at Agent.Server._listen2 (net.js:1156:14)
        at listen (net.js:1182:10)
        at Agent.Server.listen (net.js:1267:5)
        at Object.start (_debugger_agent.js:20:9)
        at startup (node.js:86:9)
        at node.js:814:3

To resolve

Error : listen EADDRINUSE

I have tried closing other Terminal window (in which my node-inspector was running). I have referred to the answers already here on StackOverflow but they didn't work I have even tried giving this command to kill processes :

$ killall -9 node 
No matching processes belonging to you were found

but still its not working. Somebody please help me out with this.

like image 399
Prerna Jain Avatar asked Dec 24 '22 16:12

Prerna Jain


2 Answers

I see that you are using sudo so this is not a permissions issue.

It definitely seems like the port is already in use. You should check to see which process is using the port, then kill that process.

like image 106
Codebling Avatar answered Dec 27 '22 06:12

Codebling


There is a known issue with using sails debug on Node v12.0. There's a patch which will be released with the next version of Sails (v0.12).

In the meantime you can either install the edge version of Sails from Github or apply the patch yourself by replacing your Sails' /lib/hooks/grunt/index.js file with the contents of https://raw.githubusercontent.com/balderdashy/sails/88ffc0ed9949f8c74ea390efb5610b0e378fa02c/lib/hooks/grunt/index.js.

like image 21
sgress454 Avatar answered Dec 27 '22 05:12

sgress454