NDB DEBUGGER Error: listen EADDRINUSE: address already in use :::8000 - node.js

I'm using ndb debugger to debug my node-express application. I get the following error when I click on run the script in the chromium browser.
Error: listen EADDRINUSE: address already in use :::8000

So, I just ran into this issue. Likely, you still have the node process running. Stop the node process and then you will be all set

In order to stop all node processes, you need to stop those, by running the following command in CMD
taskkill /F /IM node.exe

Related

I get a EADDRINUSE error when I try to start a node.js server on OpenShift

So, I successfully commited a node.js app to OpenShift - without getting any error - but it does not work (error 503 when trying to access it through my browser, connection timeout when running tests against it from my local machine). The output when commiting says that node and mysql start successfully, and that the build succeeded.
I accessed the server through ssh, and checked the node log. It says an EADDRINUSE occured: Error: listen EADDRINUSE :::8080.
In my configuration, I use:
"server":{
"host":"OPENSHIFT_NODEJS_IP",
"port":"OPENSHIFT_NODEJS_PORT"
}
I also checked available environement variables in the shell with export and both are there, and 8080 is the right port.
When running ps in the shell, it does show only the programs ps and bash running. EADDRINUSE should mean that the port is already in use by another program, but I don't see anything running... I can't run netstat (permission denied).
I tried various combinations of stop/start/restart, but I always get the same error.
I am pretty lost at this point. Any pointers would be appreciated!
I found the problem. Locally, I used to start the server with app.listen(port);, which is enough to run it and access it on localhost. But that does not work on OpenShift. The host needs to be specified too: app.listen(port, host);.

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.
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.
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.
First, find your task that uses port 1337:
netstat -ano | findstr : 1337 (port number)
Then kill it:
tskill (process ID (PID))
It can solve your problem

can't end node.js application through ctrl-c on MAC

I am a node.js user for sometime and now this is my first time to work node.js on the mac, in the terminal I tried to end the node.js application server on port 8080 through the ctrl-c, it seemed the application stopped, but when I started the application again, the error 'error: Error: listen EADDRINUSE' throw out.
by using sudo lsof -nP -iTCP:8080-sTCP:LISTEN, I found the node.js server is actually not closed down for some reason by using the ctrl-c. now I have to force close the node.js process through terminal command sudo killall -KILL node.
Could anyone experience the same thing on mac
The socket(s) need to be closed on exit as well.
Try adding the next code to your node application:
process.on('SIGINT', function() {
socket.close();
process.exit();
});

Node npm start error port listen on mac

I generate new express app and when im click npm start and then ctrl+c to exit and try again to do npm start i get this error:
Error:listen EADDRINUSE
What is the problem?
Depends on what is in an app. Your process can detach from console or spawn another process, which continue to bind the port.
It happens when another server is running in the same port that you are trying to open a new server

Error: listen EADDRINUSE when trying to run an Express.js application?

When I try to run my application an Express.js server, the first time with a new port works fine, but then when I try to run it again on that port, I get the "Error: listen EADDRINUSE" error.
I already tried killing all the possible node/gulp processes, also, checked netstat and I do not see port 8080 being used by anything.
What could be the culprit?
This usually happens if the node process is still running your app when you go to run it again. Express will try to bind to the same port but it's already being use by the last node instance you created.
Kill all node processes and try again.
I know that this post is very old. But right now I saw something.
When I was in the same situation as you are in, I opened the console in my browser and I can see some errors. When I solved those errors, everything works fine.

Resources