-
-
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
Nodemon frequently leaves the child process running (detached) #1025
Comments
Oddly enough I have started to have the same issue here. I didn't used to experience this before, and I am not sure what I updated to begin to have this problem. OS X El Capitan |
Same here, I get a EADDRINUSE error too in my express server OS X Sierra |
nodemon spawns 31962, but 31963 still stays put (I think 31963 is a child process of 31962). Then when restarting, this causes a problem, because 31963 still has the server running. Update: |
I'm having the same problem. Has anyone found a solution yet? |
I was having the same issue and it seemed to pop up out of no where. I started adding this to the bottom of my entry js file so that it was the last executed lines of my script, and it seemed to clear up the issue for me. Hope it helps! I exit my nodemon process in iTerm with CTRL+C and on a mac running OSX Sierra 10.12.5.
|
Same issue, it's ok if I CTRL+C out of it and launch
|
Same issue, how to solve it?
Edit:
|
Having the same exact issue over here. |
Sorry, the only thing I've found after multiple testing is a clean OS installation fixed this for me under Linux. Of course I won't clean install every time, I was just messing around. |
Same here on OSX. Keeping all node processes running (1.12.0) |
Any solution to this issue? |
No, I didn't face the issue again, yet. I don't know what cause nodemon to lose the process. |
Any solutions? |
I've also been experiencing this issue on ubuntu 16.04, nodemon 1.12.1 and node v8. Haven't found a solution aside from manually killing the process. |
To further elaborate what I did on my previous comment - the signal ( I created a file called
and in my package.json, since I use npm scripts, running nodemon should be sufficient:
|
The problem is on |
To rid your app/program of this error on windows, you have to kill the PID process at port 3000. |
The real problem here is that The solution to this is modifying Using I've created a simple PR here that addresses the issue (but does not yet pass CI tests): #1134 Hopefully the maintainer can further flesh out the code, or if I find future time to help out I will. A temporary fix that one can apply to address this is: // NOTE: this ONLY works when using nodemon as a `require` module.
// I don't have a solution for booting nodemon from the CLI. Sorry!
var nodemon = require('nodemon');
process
// Handle normal exits
.on('exit', (code) => {
nodemon.emit('quit');
process.exit(code);
})
// Handle CTRL+C
.on('SIGINT', () => {
nodemon.emit('quit');
process.exit(0);
}); tl;dr |
I remember going through the whole hoop jumping of working out which method is the right one. IIRC Feel free to send a PR that passes all the tests if you think this will work though. |
Ah, sorry, missed the PR, but yeah, it fails and I suspect it's because you're forking. |
Well, yeah, like I said, and as it states in the
|
I'll see if I can continue on with the PR but it may not be a while. The Do your tests check for a child PID or check for stdin/out, or ..? |
If you're convinced that |
Because of this issue remy/nodemon#1025 ➕babel-wathc ➖nodemon⚠️ It may crash when saving files quickly (detail: TypeError: First argument must be file descriptor https://github.com/kmagiera/babel-watch/blob/0bb38ce492b32ae196574a8b36daa79c5a7f61e5/babel-watch.js#L291)
Same issue here, I guess it started a few days ago when I went from NodeJS 6.4.0 to NodeJS 8.90 It happens when I first stop Now I have to manually shut down Node process through Task Manager each time [Windows 10] |
Same issue here.
|
@heisian's work here has been merged, and should solve this issue for you all. 👏 Currently live in nodemon@1.12.6 |
suh weeet! happy to have helped. |
@heisian a few bits are hosed here and there, but I've got a change going up now that should work around it (mostly around passing launch args to node itself). |
@bennyn You could add any E.g.
|
I see! So it's a flag that got removed in |
Same issue here |
everything not works for me :( |
i was using visual studio terminal ,Ubuntu 18,one way was to quit terminal ,find process and kill it |
Up |
Check if you have nodemon installed globally. Removing it fixed the issue for me. |
I was using dotenv library for environment variables and I encountered the same problem. For me it was '.env' file. It was like: Don't forget to remove commas if you are copy pasting from json. |
this what solved the problem for me |
The option |
Have you configured it in |
I'm having the same issue right now. Tried to debug event loop if there is anything left but seems like no.
Has anybody figured out the right, clean solution for this? |
On windows stop "node.exe Node.js: Server-side JavaScript" processes. Add on bottom of your js file, where you are starting server put this: You're welcome! |
Just FYI if any still struggling do try this also: |
So there is no way to kill nodemon when it runs ??? |
Just updated to the latest nodemon and bumped from node 6 to 10 along with NPM upgrade and running into this: |
@doc82 this particular issue is extremely complicated and is rarely the same thing each time. You'll want to raise a new issue with full details on how to replicate, because 9 times out of 10 it's in the way nodemon is being run on your project that causes the "hanging subprocess". |
I was facing an error with the following:- [nodemon] restarting due to changes... Error: listen EADDRINUSE :::3000 Error: listen EADDRINUSE :::3000 If you get a code like this: Error: The module '/home/dg/junesis/node_modules/bcrypt/lib/binding/bcrypt_lib.node' You need to run the following commands: However, I happened to solve the problem using the below code in my entry file:
Thanks to #1025 (comment) |
This Helped! Thanks! Added |
I'm hitting this same issue and I'm not 100% sure why but I just edited my start scripts to include a kill command. This should work if your only using mac/*nix for development like I am, modify your start script to kill whatever is using the port on start like so:
3000 is the port youre using. |
I have never had this problem before but started getting it now all of the sudden. Ubuntu 18.04 |
Same here on both tools' versions. It seems this issue pops up periodically from a myriad of causes. Since this thread seems to be the best source of info, I think it should be reopened. |
Wait, hang on, nodemon is still running after I kill the process! I noticed after I tweaked a server file, and suddenly the pid appeared again. I'm running nodemon with concurrently, so I don't know if that makes any difference. |
I've been experiencing that problem for the past week on a new Hapi project. 4 times out of 5, I get the EADDRINUSE error when nodemon reloads. But I cannot reproduce that error when working with older projects, using older versions of Hapi and the same version of nodemon ( |
Yep, with @Ratstail91 - should be reopened. |
Hi, I got the same problem here, starting from today. I tried everthing below and NOTHING worked:
The funny thing is I updated nodemon yesterday... Message error is =>
And by the way, i have a weird socket file "3000" that is created on project directory, any hints on where that comes from ? |
I also face this issue on |
I'm also facing the same issue, I need to save the project 3/4 times in a row to get it working. |
Am locking this issue. It was based on 3 year old code, had a pr merge and fixed the source of the problem. People posting more recently are experiencing similar symptoms but not the same source (plus there's never any info to replicate). Will take a pr to fix these new issues. Thanks. |
I am using Nodemon to restart an Express server in development. I even clean up with
server.close()
on process exit. But I frequently get "Port 3000 is already in use" when it starts, suggesting nodemon failed to kill the old child process, and it is still running as a detached process. I have to kill nodemon, runkillall node
, and restart nodemon again. Is this a known problem? Are there any workarounds?The text was updated successfully, but these errors were encountered: