Intermittent EADDRINUSE :::5000

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP



Intermittent EADDRINUSE :::5000



So, sometimes when I reboot my server it fixes it and sometimes it doesn't but I continuously get Error: listen EADDRINUSE :::5000. In my package.json in my client I have a proxy for "proxy": "http://localhost:5000" and I changed that to port 3000 to test it, still issue persisted. I went into server.js and tried just changing the port but any port I change it to it says it's in use. So, it has to be an issue with how I am setting up express i'm assuming. I just don't know what to even change since it's intermittent.


Error: listen EADDRINUSE :::5000


package.json


"proxy": "http://localhost:5000"


server.js



Also it's weird my server is still running because my socket works...



edit
Here are my scripts:


"scripts":
"client-install": "npm install --prefix client",
"start": "node server.js",
"server": "nodemon server.js",
"client": "npm start --prefix client",
"dev": "concurrently "npm run server" "npm run client"",
,



server.js snippet


const express = require("express");
const app = express();
const port = process.env.PORT || 5000;
var server = app.listen(port, () =>
console.log(`Server running on port $port`)
);
var io = (module.exports.io = require("socket.io").listen(server));





Can you run netstat or similar tool to identify the process that is binding to the port? I assume that if it occurs after reboot that the problem is either caused externally or at startup, not during teardown/exit of your app.
– akaphenom
Aug 10 at 17:57





What commands do you use to to run the server?
– Horia Coman
Aug 11 at 14:45





"dev": "concurrently "npm run server" "npm run client"", And then I just run npm run dev
– user10204157
Aug 11 at 14:46



"dev": "concurrently "npm run server" "npm run client"",




1 Answer
1



I ended up just using killall node if I ran into this issue


killall node






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Firebase Auth - with Email and Password - Check user already registered

Dynamically update html content plain JS

How to determine optimal route across keyboard