-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EADDRINUSE in 2.0.12 version #1893
Comments
Can you add in the prerequisite details in the initial issue - so I know what versions, etc (not the nodemon version). |
You're going to need to pare that down. Plus, I've not idea what hpt-backend is. Also, I don't know what version of Windows or node you're using. Or what shell... |
Simplified code and package.json to a minimum (1 post updated) and still run into error. |
Yeah, I can replicate now, but I strongly suspect it's because you've got nodemon on top of about 5 or 6 so nested processes. I'm just reworking the package undo that... |
Im clean and delete all of scripts and still run into error. Check 1 post – i edited it. |
Looks like it is windows only error. Cant reproduce it on ubuntu 20.04 and node version 16.5.0. Will try to update node on windows to 16.5.0 and test it again. |
ACK - will check with updated info 👍 |
Checked windows 10, node 16.5.0 - same issue. Looks like its Windows only issue. |
I have a similar problem, but it exists since Version 2.0.8, and every following version. Did these versions work fine for you? @DzenDyn |
Yes it started from 2.0.8. Looks like same issue |
You can fix this issue by downgrading nodemon to version 2.0.7. |
Minimum reproduction (via npm) in repo for convenience: https://github.com/Aareksio/nodemon-bug-2.0.8 This is degradation between 2.0.7 and 2.0.8 (probably 500c1b0) I do not know much about how the signals work, but if they do not propagate down, I fear it may be infeasible to find exact process in the chain we need to SIGINT. Running https://github.com/remy/nodemon/blob/main/lib/monitor/run.js#L345-L351 recursively may reveal the bottom-most process, but it may not be necessarily the one that needs to be SIGINTed. Perhaps reverting to old behavior behind an optional flag (here: https://github.com/remy/nodemon/blob/main/lib/monitor/run.js#L327) is a solution to avoid downgrading to 2.0.7 until it's fixed for good? |
@Aareksio one of solutions – migrate to wsl2, and run project into linux enviroment with latest nodemon, or downgrade to 2.0.7. |
Can we try with |
@remy hello! Just tried. Ran into same error. Node.js v16.5.0 |
@DzenDyn for my own sanity, can you strip yarn from the process and run only |
@remy https://github.com/Aareksio/nodemon-bug-2.0.8 The issue is with running the node script through proxy (such as npm, yarn or ts-node). It works well when calling 1. npm run dev -> nodemon2. npx nodemon index.jsThe problem is in this code finding proxy process - the first child, not the main script. |
Okay, we're making some progress then. The "fix" that was put in place in 2.0.8 was specifically to handle spawned sub-processes, but it looks like in the cases you're seeing it's not actually stopping the process. This is good though, it helps narrow the issue. |
@remy Yes, removing "exec" prop does work in the minimalistic example. What if we need more complex "exec" command though? For example we want to add |
You can pass |
I'm getting same error on V2.0.7 too. |
I recently upgraded nodemon from v2.0.7 (which worked just fine!) to v2.0.12. Now (with v2.0.12) I am seeing a lot of errors on Windows 10 when nodemon restarts my server:
Here is what my {
"exec": "yarn start:server",
"ext": "ts",
"signal": "SIGHUP"
} And this is my
The import 'dotenv-defaults/config';
import 'reflect-metadata';
import {NestServer} from '../server/NestServer';
async function start(): Promise<void> {
const server = new NestServer();
await server.start();
}
start().catch(error => {
console.error(error);
process.exit(1);
}); |
I'm getting this on OSX too so I don't think it's exclusively Windows. Any update here? |
Nodemon 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. (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:
package.json:
nodemon.json:
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.
The text was updated successfully, but these errors were encountered: