nodemon -v: 1.18.6node -v: 11.2.0After detecting changes, nodemon should kill the current process and execute a new one.
Nodemon detects the changes but fails to actually restart the program. Additionally, every change made to my file produces two lines indicating that the change has been recognized. The following is the output after running npm start and changing the file exactly once:
[nodemon] starting `node app.js`
hello cruel world
[nodemon] restarting due to changes...
[nodemon] restarting due to changes...
If the process exits on its own, nodemon has no issue restarting after a change. It is only an issue if the process is still executing while the changes are detected.
I tried running nodemon locally and globally as well as reinstalling node and npm entirely.
Here is the simplest application to reproduce the problem:
console.log("hello cruel world");
while(true) {};
If applicable, please append the --dump flag on your command and include the output here ensuring to remove any sensitive/personal details or tokens.
Can you try with [email protected]?
Updated and no change in issue.
One interesting thing: After I click to close the command prompt I launched nodemon from, It will actually restart the test app quickly before the window disappears. I will see "hello cruel world" again in the output for a second. But only once, even if it I've changed the file multiple times.
@jessedewald I tried to reproduce this issue since I'm on Windows 10, but I'm not having any luck. Here's the output I get when I run the code you provided and then save it again in my editor to trigger a restart:
```E:\projects\github\nodemon-1461> npm run start
nodemon-1461@ start E:\projects\github\nodemon-1461
nodemon ./app.js
[nodemon] 1.18.7
[nodemon] to restart at any time, enter rs
[nodemon] watching: .
[nodemon] starting node ./app.js
hello cruel world
[nodemon] restarting due to changes...
[nodemon] starting node ./app.js
hello cruel world
[nodemon] restarting due to changes...
[nodemon] starting node ./app.js
hello cruel world
```
I tried PowerShell (PSVersion 5.1.16299.492), Git Bash, and Cmd Prompt. I'm not saying there isn't an issue here somewhere, but I would need more information to investigate further.
I had the same problem, updating the new version 1.18.7 is solved
Update: I did a clean reinstall of Windows and the issue is now resolved.
Running:
node v11.3.0
nodemon 1.18.7
I setup node before anything else on a hunch that something about my setup was conflicting with nodemon. It must have been either that, or some issue with node 11.2.0. I will periodically test as I setup the machine again and report back if any issue. Appreciate the attention and the effort on this project!
I found the same issues on macOS in my express js app.
node v11.2.0
nodemon - 1.18.7
@drobnikj can you provide parred down example?
@remy Thanks, I solve it.
I found which file restarts process using --verbose flag.
Then I made some changes to this file. After the change, it works without restarting.
This issue has been automatically marked as idle and stale because it hasn't had any recent activity. It will be automtically closed if no further activity occurs. If you think this is wrong, or the problem still persists, just pop a reply in the comments and @remy will (try!) to follow up.
Thank you for contributing <3
Hey, I've been using node, and am having the same issue. I've uninstalled and reinstalled node, tried the Latest and LTS versions, I've added nodemon and removed it several times, tried nodemon -L to no avail, switched from cmd, to git bash to powershell, and yet nodemon will properly restart the server. I'm using VSCode on Windows 10, and will note that a colleague, running the same code on a mac-book, cannot reproduce the issue. I've also noticed that, as long as the server file doesn't have _server.listen()_ in it, the restart bug goes away, but as soon as I add that line of code with a port, the file starts hanging. Let me know if you would like/require anymore information.
This issue has been automatically marked as idle and stale because it hasn't had any recent activity. It will be automtically closed if no further activity occurs. If you think this is wrong, or the problem still persists, just pop a reply in the comments and @remy will (try!) to follow up.
Thank you for contributing <3
Can this issue be solved only by reinstall of windows at present?
Can this issue be solved only by reinstall of windows at present?
I've found node-dev to be a pretty useful stand-in for nodemon on Windows, the pop-ups are a _little_ annoying but that's about it. Might be worth a try: https://www.npmjs.com/package/node-dev
Still issue (annoying) in Windows
In my case, the problem was that i was using another date for testing in my project, so when i saved the changes the new files had a different date, when restarting the server the nodemon was chekcing for the lastest files, but they had different timestamp so it restarted many times, it was fixed by setting the time and the tz of my computer to the correct one, so everytime i want to save a file i need to bring it back to the correct time
Same issue here at Win7 in 2020. Sad.
Same issue here with Win7 in 2020.
Same issue here with Win10 in 2020 Feb.
Same issue with Win10 in march 2020
No one posted a pr and the issue became stale. Locking. Happy to take a new issue with a pr that fixes it.
Most helpful comment
Still issue (annoying) in Windows