-
Notifications
You must be signed in to change notification settings - Fork 76
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
gulp-watch & gulp-nodemon #77
Comments
I have the same issue. |
Same here. After quitting gulp with Ctrl + c, the process continues to run - and when I enter any key on the bash command line, the process finally ends with an error:
I've tried different methods to prevent this, but so far no success. The only workable way I found was to run nodemon and gulp separately. I'll be checking back on this ticket to see if anyone finds a better solution. Edit: In my case, the issue was not with gulp-nodemon but a mistake in the setup. I had a watch task manually reloading browser-sync, when it was already watching the same files. |
same |
For me, the following finally solved this issue:
Without this handler, the process doesn't exit on Ctrl+C and then throws an error on |
|
Thank you for this thread I've been having this issue for the last couple weeks and couldn't figure out why. I used a modified version of @eliot-akira fix. Which seems to have removed the error.
|
@theverything Listening for SIGINT like @eliot-akira mentions seems to work better for now at least. |
@eliot-akira thank you! |
@theverything Just what I was looking for. Thanks! |
I think this is a duplicate of #33. |
The following works pretty well for me: nodemon.on('start', () => {
debug('nodemon has started app');
}).on('quit', () => {
debug('nodedmon has quit');
process.exit();
}).on('restart', function(files) {
debug('App restarted due to: ', files);
}); |
I kept getting this annoying problem after following this tutorial which is best described in this gulp thread. ColemanGariety/gulp-nodemon#77. I'm not using gulp but the problem is the same. By adding process.exit() on nodemon quit the problem goes away smoothly. Maybe add this process.exit() hint in the docs here?
I kept getting this annoying problem after following this tutorial which is best described in this gulp thread. ColemanGariety/gulp-nodemon#77. I'm not using gulp but the problem is the same. By adding process.exit() on nodemon quit the problem goes away smoothly. Maybe add this process.exit() hint in the docs here?
Based on ColemanGariety/gulp-nodemon@8ee28a46a9f335d9ba bf0131fde29b646cc621c3 Notes: - ColemanGariety/gulp-nodemon#77 work on Mac but not Windows. - Not listening to SIGTERM, like https://github.com/webpack/webpack-dev-server/blob/93cb3dc600e6c547cec75 80ace4bf4a56cf2fe98/bin/webpack-dev-server.js - Also consider https://github.com/sindresorhus/exit-hook and it’s active fork.
* Fix: Nodemon not stopping on windows upon Ctrl-C * Refactor: change process.exit comments. Based on ColemanGariety/gulp-nodemon@8ee28a46a9f335d9ba bf0131fde29b646cc621c3 Notes: - ColemanGariety/gulp-nodemon#77 work on Mac but not Windows. - Not listening to SIGTERM, like https://github.com/webpack/webpack-dev-server/blob/93cb3dc600e6c547cec75 80ace4bf4a56cf2fe98/bin/webpack-dev-server.js - Also consider https://github.com/sindresorhus/exit-hook and it’s active fork.
I'm using
gulp-watch
package that starts also gulp-nodemon, like so:However, when I quit the gulp watch command with Ctrl + c, then nodemon process is still running. Is there a way how to cleanly exit the process?
The text was updated successfully, but these errors were encountered: