EADDRINUSE in 2.0.12 version
See original GitHub issueNodemon version 2.0.12 run nodemon after change or rs i have error: Error: listen EADDRINUSE: address already in use :::3007
`events.js:291 throw er; // Unhandled ‘error’ event ^
Error: listen EADDRINUSE: address already in use :::3007 at Server.setupListenHandle [as _listen2] (net.js:1316:16) at listenInCluster (net.js:1364:12) at Server.listen (net.js:1450:7) at Object.<anonymous> (C:\Users\Nikiforov.Evgeny\Documents\projects\passport\bin\app.js:35:15) at Module._compile (internal/modules/cjs/loader.js:1256:30) at Object.Module._extensions…js (internal/modules/cjs/loader.js:1277:10) at Module.load (internal/modules/cjs/loader.js:1105:32) at Function.Module._load (internal/modules/cjs/loader.js:967:14) at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12) at internal/main/run_main_module.js:17:47 Emitted ‘error’ event on Server instance at: at emitErrorNT (net.js:1343:8) at processTicksAndRejections (internal/process/task_queues.js:80:21) { code: ‘EADDRINUSE’, errno: -4091, syscall: ‘listen’, address: ‘::’, port: 3007 } `
When i rollback to version 2.0.7 - i have no errors.
Setps to reproduce:
app.js:
import express from 'express';
const server = express();
server.use(express.urlencoded({ extended: true }));
server.use(express.json());
server.listen(3007, () => {
console.info(
'Listening on http://localhost\nOpen http://localhost/v1/api-docs for documentation'
);
});
package.json:
{
"name": "nodemontest",
"version": "1.0.0",
"description": "test nodemon error eaddrinuse",
"main": "app.js",
"license": "MIT",
"type": "module",
"dependencies": {
"express": "^4.17.1"
},
"devDependencies": {
"nodemon": "^2.0.7"
},
"scripts": {
"server": "node ./src/app.js",
"watch": "nodemon"
}
}
nodemon.json:
{
"watch": ["src/*"],
"ext": "js, json, yaml",
"exec": "yarn server"
}
- yarn watch
- wait while server run
- type rs and press enter or add some comment to app.js
I have Node.js v14.7.0. Windows 10 Version 1903 (Build 18362.239) Powershell version 5.1.18362.145
The usual windows command line (cmd.exe) has the same error. It looks like it’s not about the terminal.
Issue Analytics
- State:
- Created 2 years ago
- Comments:37 (15 by maintainers)

Top Related StackOverflow Question
You can fix this issue by downgrading nodemon to version 2.0.7.
You can pass
-rdirectly to nodemon, but that’s not the point - now I know where to look for the issue and how to confirm any fixes.