question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Nodemon is not able to gracefully restart applications in Windows environment

See original GitHub issue

Possibly related to https://github.com/remy/nodemon/issues/1567

  • nodemon -v: 6.13.4

  • node -v: v12.16.1

  • Operating system/terminal environment:

    • Windows Command Prompt, Windows Git Bash, Windows Terminal WSL
         Edition: Windows 10 Pro 
         Version: 1909
    Installed on: 5/22/2019
        OS Build: 18363.836 
    
  • Command ran: nodemon --signal SIGHUP index.js

Expected behaviour

On Windows, Nodemon should wait for the process to complete if it handles a shut down signal.

Notice the express server closed message

WSL: wsl

Actual behaviour

The application is killed and restarted right away. This behavior does not exist in Linux, Mac and WSL.

CMD: windows

Steps to reproduce

I have created a sample Express app here: https://github.com/chriswoodle/nodemon-1567 that shuts down the express server once the application is signaled to stop ['SIGTERM', 'SIGINT', 'SIGHUP']

git clone https://github.com/chriswoodle/nodemon-1567.git
cd nodemon-1567
npm install
npm start
touch index.js

Let me know if I can provide any more information or test changes, thanks.


Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:11
  • Comments:50 (24 by maintainers)

github_iconTop GitHub Comments

13reactions
remycommented, May 16, 2020

If I get time, I’ll look into this, but I wanted to stop and say:

Thank you for filing an issue with a good level of detail and a good example of pared down code to replicate the issue. I’ll be pointing people to this issue as an example of what makes the world of difference in debugging. 🙏

3reactions
usm076commented, Oct 7, 2020

Still isn’t resolved

Read more comments on GitHub >

github_iconTop Results From Across the Web

'nodemon' is not recognized as an internal or external command
'nodemon' is not recognized as an internal or external command # · Open the start search and type in env and then click...
Read more >
Port 3000 is already in use [nodemon] app crashed - waiting ...
If your app listens in on SIGTERM to shutdown gracefully when nodemon triggers tskill command, Windows will unconditionally terminate your ...
Read more >
nodemon | Yarn - Package Manager
Automatic re-running. nodemon was originally written to restart hanging processes such as web servers, but now supports apps that cleanly exit. If your...
Read more >
nodemon - Bountysource
Nodemon is not able to gracefully restart applications in Windows environment $ 0 ... Created 2 years ago in remy/nodemon with 44 comments....
Read more >
A Complete Guide to Node.js Process Management with PM2
pm2-dev : a development tool for restarting your application when file ... option to ensure that a graceful shutdown does not take too...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found