remy / nodemon

Monitor for any changes in your node.js application and automatically restart the server - perfect for development
http://nodemon.io/
MIT License
26.31k stars 1.73k forks source link

nodemon not restarting automatically after i make changes in the index.js file #2054

Closed Sagar-Gondage closed 2 years ago

Sagar-Gondage commented 2 years ago

Hi There, if i run the command nodemon run start it works for the first time and i see the result at port number as well but whenever i make changes in the index.js file server is not restarting automatically to see the changes i have to stop the nodemon and start it again every time. terminal is stuck at -> [nodemon] restarting due to changes...

I have attached screenshot after making change in index.js also terminal which contains command, package.json file, index.js file and folder structure as well.

I tried to downgrade the version of nodemon as well but still facing the same issue. OS that i am using is windows 11. nodemon-verson -> 2.0.19

image

remy commented 2 years ago

Add the following env value to see the debug: DEBUG=nodemon:*,nodemon then share the output - it'll probably tell you what it's actually doing.

Sagar-Gondage commented 2 years ago

where to add them i which file? and where? i am little confused here. i even searched on internet that where to add DEBUG=nodemon:*,nodemon but i did not find anything useful. could you help here? Thank you!

remy commented 2 years ago

That's an environment setting. Before you run nodemon, IIRC, windows requires you set the values like this: set DEBUG='...' (going by this post: https://www.shellhacks.com/windows-set-environment-variable-cmd-powershell/)

Sagar-Gondage commented 2 years ago

i have added the env variable image but i am still getting the same error in vscode terminal image

remy commented 2 years ago

This is what the debug output looks like:

SCR-20220817-e2j

You'll need to work out how to set the environment value in the terminal window you're using in VS Code. I can't really help you with VS Code support I'm afraid.

Sagar-Gondage commented 2 years ago

ok thank you!

fredd2359 commented 9 months ago

Hello @remy hope you could help me out with this issue as well. Im having the same isue here and belive me that Ive seen a lot of the other issues here but can not get a solution.

Currently I have: nodemon global: 3.0.2 node: 20.10.0 npm global : 10.2.3 Windows 10 cmd terminal, powershell, and VSCode terminal doing the same.

I've tried:

Here are some captures wit the DEBUG setting

image

It starts just good on port 5000 but when I do some chenges it does catch it but it gets stucked on the restart

Here is my code

image

image

I'm sure that the issue is not the nodemon library but maybe you have already figured what is causing this issue, thanks!

Jahnavi-16 commented 7 months ago

Even I have the same isuue and I tried adding start in the script in package.json but its still showing the same error any ideas how to fix it ? It was previiously working fine and Im not sure what caused this change ..

IVEWOR commented 4 months ago

Same thing happening to me right now. But it's caused by something else like I just ordered some pastries for my GF and the delivery guy called her number and asked for my name and her mother picked up the phone because my GF left her phone at her mother house and her don't know who I am. Now, I'm f**ked.

My nodemon is not working, my vision is blurry, my gf is mad, I just lost a chess game to 6 years old niece, and I don't know what to do!

Vaten0x commented 1 month ago

It works after I changed these:

  1. don't use powershell, use ubuntu or linux for it
  2. npx nodemon -L server.js