Skip to content
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 not restarting: [nodemon] restarting due to changes. #1882

Closed
moksedulislam opened this issue Jul 7, 2021 · 49 comments
Closed

Nodemon not restarting: [nodemon] restarting due to changes. #1882

moksedulislam opened this issue Jul 7, 2021 · 49 comments

Comments

@moksedulislam
Copy link

Nodemon not restarting: [nodemon] restarting due to changes... i use vs code if change my code but not update my code browser and show restarting use due to change

  • nodemon -v:2.0.9
  • node -v:v16.0.0
  • Operating system/terminal environment: windows 10 vs code terminal
  • Using Docker? What image:
  • Command you ran: nodemon index.js

Expected behaviour

const http = require("http"); const PORT = 3000; const hostName = "127.0.0.1"; const server = http.createServer((req,res) => { res.end("Welco my server server test test"); }) server.listen(PORT,hostName, () => { console.log(server is running at http://${hostName}:${PORT}) })

Actual behaviour

Steps to reproduce

[nodemon] 2.0.9
[nodemon] to restart at any time, enter rs
[nodemon] watching path(s): .
[nodemon] watching extensions: js,mjs,json
[nodemon] starting node index.js
server is running at http://127.0.0.1:3000
[nodemon] restarting due to changes...
[nodemon] restarting due to changes...


If applicable, please append the --dump flag on your command and include the output here ensuring to remove any sensitive/personal details or tokens.

@Pitonuss
Copy link

Pitonuss commented Jul 9, 2021

Same problem.

nodemon -v:2.0.8/2.0.9/2.0.10
node -v:v14.17.3
Operating system/terminal environment: windows 10 vs code terminal

The latest version where it works correctly is 2.0.7

@milanmdev
Copy link

milanmdev commented Jul 9, 2021

On v2.0.10 is where it's broken iirc. v2.0.11 is working fine for me (MacOS)

@remy
Copy link
Owner

remy commented Jul 10, 2021

Can you all (3 ppl) provide screenshots of the screens showing what you're seeing

@moksedulislam
Copy link
Author

Can you all (3 ppl) provide screenshots of the screens showing what you're seeing

Screenshot_20

@milanmdev
Copy link

Can you all (3 ppl) provide screenshots of the screens showing what you're seeing

Currently not at my Windows pc. The error occurs over there, but not on my Mac.

@mikenavi
Copy link

mikenavi commented Jul 10, 2021

same issue

node -v15.14.0
nodemon -v:2.0.8+
w10, terminal

Image 24

@remy
Copy link
Owner

remy commented Jul 10, 2021

Those of you on node 15 and 16, can you test with node 14 (or 12) just to rule node versions out of the equation?

@mikenavi
Copy link

mikenavi commented Jul 10, 2021

Those of you on node 15 and 16, can you test with node 14 (or 12) just to rule node versions out of the equation?

Image 25

nodemon -v:2.0.9

@remy remy added the windows label Jul 14, 2021
@vayupuk
Copy link

vayupuk commented Jul 20, 2021

I have same problem.
node v 14.17.3
nodemon v 2.0.12

And I fixed that by installed nodemon @2.0.7

then It work.

@Sergey-Zhestovsky
Copy link

Have kind of the same problem.
node v 16.4.0
nodemon v ^2.0.8

Fixed by installing nodemon@2.0.7.

Although for me, server is restarting, but several times for no reason.
Screenshot 2021-07-23 125641

@remy
Copy link
Owner

remy commented Jul 27, 2021

Just to rule it out - can we try with nodemon@2.0.13-alpha.1 aka npm install -g nodemon@debug and report back? Thank you.

@mikenavi
Copy link

Just to rule it out - can we try with nodemon@2.0.13-alpha.1 aka npm install -g nodemon@debug and report back? Thank you.

no changes in my case

image

@Icaruk
Copy link

Icaruk commented Aug 3, 2021

npm i -g nodemon@2.0.7
(remove -g if your nodemon is not global)

Fixed the issue for me.

@Bikramghimire
Copy link

Screenshot (131)
how you guys solve this problem anyone?? tired everything install nodemon globally degraded the version to 2.0.7, even uninstall nodejs and install new node and added all path in environment variables .......

@Icaruk
Copy link

Icaruk commented Aug 5, 2021

Screenshot (131)
how you guys solve this problem anyone?? tired everything install nodemon globally degraded the version to 2.0.7, even uninstall nodejs and install new node and added all path in environment variables .......

Try to npm un nodemon on your project.
Then npm i -g nodemon@2.0.7.

Terminate process and try again.

@lukas-bryla
Copy link

I had the same problem. Downgrading -g nodemon to 2.0.7 fixed it.

@jasonluo07
Copy link

I have the same problem.
node -v 14.16.0
nodemon -v 2.0.7

Screenshot_1

@Icaruk
Copy link

Icaruk commented Sep 6, 2021

I have the same problem.
node -v 14.16.0
nodemon -v 2.0.7

Screenshot_1

Check if you have installed nodemon globally

@Bikramghimire
Copy link

I have the same problem.
node -v 14.16.0
nodemon -v 2.0.7

Screenshot_1

i have also the same problem. i tried every thing find on internet but does not work then i used alternative of nodemon . recently , i have reset my operating system then i install nodemon then it works so OS was causing the problem.

@jasonluo07
Copy link

I have the same problem.
node -v 14.16.0
nodemon -v 2.0.7
Screenshot_1

Check if you have installed nodemon globally

Yes, nodemon is installed globally.

@niquedegraaff
Copy link

I can verify that it is broken above 2.0.7

@curtiskeisler
Copy link

I have same problem.
node v 14.17.3
nodemon v 2.0.12

And I fixed that by installed nodemon @2.0.7

then It work.

I had the same problem,
nodemon 2.0.12
Windows 10
VS Code 1.60.0
Node.js 14.16.0

down graded to nodemon 2.0.7 and it works beautifully again when I save . . .

restarts and works as expected

upgrade back to @latest nodemon . . . restart never occurs . . there's a message saying that it's restarting due to changes . . . it just never does.

@Icaruk
Copy link

Icaruk commented Sep 6, 2021

I have the same problem.
node -v 14.16.0
nodemon -v 2.0.7
Screenshot_1

Check if you have installed nodemon globally

Yes, nodemon is installed globally.

Uninstall locally and globally, then install the version 2.0.7

@fabriciorsf
Copy link

fabriciorsf commented Sep 16, 2021

The same problem with me at Windows 10:
nodemon -v 2.0.12
node -v 14.17.6 (lts)

The app restarts eventually when I edit&save the code.

Already with the --inspect flag it always restart.

@sb-baris
Copy link

sb-baris commented Sep 16, 2021

Same problem here on Windows 10 + VSCode.

[nodemon] restarting due to changes... but never restarts.

nodemon -v 2.0.12
node -v 12.22.4

Reverting to version nodemon v2.0.7 works around the problem for me, too. But still, an actual fix would solve my problem in our team, since I cannot commit version downgrade to our codebase.

@xairoo
Copy link

xairoo commented Sep 18, 2021

2.0.7 works.

Maybe some others run into this too:

It looks like 2.0.12 sometimes ignores some code changes. But I am not 100% sure it because of nodemon, guess nodemon doesn't use caching or so? But my SSD works fine. Windows 10 + VSCode.
Results in processing old code, the code before saving. I noticed it because of wrong (outdated) console.log() messages. This won't happen anymore since the downgrade to 2.0.7. Haven't restarted my Windows Terminal, neither have rebooted my system. It's a bit gross.

@remy
Copy link
Owner

remy commented Sep 22, 2021

If anyone is still watching this issue - let's try to hit reset.

The first thing I need is for anyone that can replicate this, or is still experiencing this issue to pipe up.

Then, if it still affects you, I need the following (sorry to be harsh, but all other "also affects me" will be either ignored or deleted - need to focus on where the issue is):

  • node -e 'console.log(node@${process.version}, ${process.platform}@${require("os").release()})'
  • node -v
  • nodemon -v
  • MOST IMPORTANTLY what shell are you running: PowerShell, git bash, etc.
  • Are you running inside of VS Code?

If you're using VS Code, I'm going to request that you replicate outside of VS Code as I'm starting to wonder if there might be something going on here because as yet I can't replicate (and I tend to cut VS Code out of the replication process since I can never be sure exactly which shell it's running).

@xairoo
Copy link

xairoo commented Sep 23, 2021

  • PowerShell v5.1.19041.1237 (Get-Host | Select-Object Version), running in Windows Terminal
  • node v14.15.4
  • nodemon v2.0.12

Can also be reproduced with git-bash and git-cmd.

@sb-baris
Copy link

The command node -e 'console.log(node@${process.version}, ${process.platform}@${require("os").release()})' didn't work on my PC, but here are its components:

  • process.version = 'v12.22.4'
  • process.platform = 'win32'
  • require("os").release() = '10.0.19043'
  • node v12.22.4
  • nodemon v2.0.12

And the important point on my side is, the problem only happens if I run it in VSCode integrated terminal (PowerShell) and in DEBUG mode. When not in debug mode, with the PowerShell in VSCode, nodemon restarts just fine, also outside VSCode.

I don't know how to run debug mode outside VSCode. So I could not check that. Also, I don't know how to change with terminal VSCode uses for debug mode.

But I tried it with WebStorm, too. There I can set which terminal is used for debug mode. And, in Debug mode, PowerShell terminal made the same problem, whereas other terminals (cmd, wsl) worked just fine in debug mode.

So on my side, the problem looks somehow related to debug+powershell, instead of VSCode directly.

@remy
Copy link
Owner

remy commented Sep 23, 2021

@sb-baris useful - thank you.

@xairoo are you running inside of vscode? are you running in debug mode (as @sb-baris comments)?

@xairoo
Copy link

xairoo commented Sep 23, 2021

@xairoo are you running inside of vscode? are you running in debug mode (as @sb-baris comments)?

* PowerShell v5.1.19041.1237 (`Get-Host | Select-Object Version`), running in Windows Terminal

directly in Windows Terminal and not in VS Code, also no debug mode. No idea if you use Windows. https://github.com/microsoft/terminal

@bartick
Copy link

bartick commented Sep 24, 2021

I have a different results than with running nodemon.
(I might be doing something wrong as today is the first day I am using nodemon)

process.version = 'v16.8.0'
process.platform = 'win32'
require("os").release() = '10.0.19043'
node v16.8.0
nodemon v2.0.12

On Using VS code It shows restarting on file edit but never restarts (cmd and powershell) .
Outside vs code (In cmd or powershell [both have same issue]) On file edits it never restarts nor even shows restart. On pressing ctrl+c it shows the restarting message but still never restarts. (I never used debug mode on the whole process)

I tried installing nodemon v2.0.7 and it works find inside and outside vs code

@AbhishekNarula28
Copy link

@remy I tried everything that was mentioned in this issue and I'm still getting the restarting due to changes error. I even tried the debug build aka npm i -g nodemon@debug but it didn't resolve the issue. Also node -e 'console.log(node@${process.version}, ${process.platform}@${require("os").release()})' command didn't work for me.
I am using:
Node v14.17.6
Nodemon v2.0.13-alpha.1
Restart

Hoping to hear from you.

@remy
Copy link
Owner

remy commented Sep 27, 2021

@AbhishekNarula28 what terminal shell are you using?

@AbhishekNarula28
Copy link

@AbhishekNarula28 what terminal shell are you using?

Powershell

@remy
Copy link
Owner

remy commented Sep 27, 2021 via email

@AbhishekNarula28
Copy link

5.1.19041.1237

@SagiDeveloper
Copy link

SagiDeveloper commented Sep 27, 2021

I had the same problem. Downgrading -g nodemon to 2.0.7 fixed it.

Worked for me (Node v14.17.6)

npm un nodemon
npm i -g nodemon@2.0.7

Terminate process and try again.

@AbhishekNarula28
Copy link

I had the same problem. Downgrading -g nodemon to 2.0.7 fixed it.

Worked for me (Node v14.17.6)

npm un nodemon npm i -g nodemon@2.0.7

Terminate process and try again.

I fixed it on 2.0.13.

@jordanlun1
Copy link

I had the same problem. Downgrading -g nodemon to 2.0.7 fixed it.

Worked for me (Node v14.17.6)
npm un nodemon npm i -g nodemon@2.0.7
Terminate process and try again.

I fixed it on 2.0.13.

I just tried 2.0.13 and it's still doing it. Fine with 2.0.7

@iagovholanda
Copy link

I managed to solve it just by changing the nodemon version to 2.0.7

npm i nodemon@2.0.7

problem soved ✔

@immortalmind2016
Copy link
Contributor

immortalmind2016 commented Oct 18, 2021

Can people following this thread test with npm i nodemon@debug and confirm if this works or not , this is the latest change with @immortalmind2016's changes.

@sb-baris
Copy link

Can people following this thread test with npm i nodemon@debug and confirm if this works or not

I just tried and it works!.
nodemon version turned into 2.0.14-alpha.1 with npm i nodemon@debug. Confirming with debug mode on Windows 10 + VSCode + PowerShell. Other environment details are the same as I mentioned before.

@immortalmind2016
Copy link
Contributor

@sb-baris thanks for the test
@remy it is working with @sb-baris

@remy remy added the has PR label Oct 19, 2021
remy pushed a commit that referenced this issue Oct 19, 2021
…1938)

Authored-by: mohamed <mohamedsalah.software@gmail.com>

Fixes: #1903, #1915, #1936, #1937, #1882, #1893
@sb-baris
Copy link

I confirm here again that the issue has been solved for my case with v2.0.14. Thank you very much.

@remy remy closed this as completed Oct 22, 2021
@JoeyFlaum
Copy link

JoeyFlaum commented Oct 29, 2021

Still not restarting for me.

Windows 10.0.19042
Node 16.13.0
Nodemon 2.0.14-alpha.1

I tried going back to 2.0.7 and 1.19.4

Error: listen EADDRINUSE: address already in use

I tried killing all ports in use and the problem just starts again when starting the nodemon script.

@remy

@immortalmind2016
Copy link
Contributor

use the last version npm install nodemon
and check if your package.json includes nodemon you may use it inside instead of global one

@JoeyFlaum
Copy link

I started with 2.0.14(latest version) which is what was not working in the first place. My last try was the 2.0.14-alpha.1 version. Nothing is working🤷‍♂️

@varun015
Copy link

Not working for me.

Repository owner locked as resolved and limited conversation to collaborators Dec 27, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests