Nodemon not restarting after filechange showing [nodemon] restarting due to changes

Viewed 377

I have installed nodemon in my nodejs using

npm install -g nodemon

now, When I run

nodemon index.js

, It starts the file.

after I make a change to my file,

it shows

[nodemon] restarting due to changes...

and it only restarts when I close the Terminal

showing

[nodemon] starting `node src/index.js`
[nodemon] restarting child process

What should I do to fix this?

2 Answers

Ok and I finally fixed it.

I downgraded nodemon to 2.0.2 by running

npm install nodemon@2.0.2 -g 

You can press Ctrl + C to back out of current operation instead of closing the terminal every time. :)

It has to restart when you make changes to the file.

Do (Ctrl and C) and then press the up arrow to get the last command and attempt to run the application again.

Related