Nodemon is not starting 'node index.js'

I am enrolled in NodeJS course, I installed nodemon and checked its version and then i use it but when start file with nodemon its showed that nodemon is started but when i made changes in the file its stuck in showing restarting due to changes.

This might be a shot in the dark but try this in your package.json:
"start": "nodemon index.js",

Then run it with
npm run start

Another idea could be your nodemon version or how you’ve installed it. There seems to be a difference to installing it as a dev dependency opposed to installing it globally. More info on that can be found here: nodemon - npm

Edit:
I just found this:

In some networked environments (such as a container running nodemon reading across a mounted drive), you will need to use the legacyWatch: true which enables Chokidar’s polling.

Via the CLI, use either --legacy-watch or -L for short:

nodemon -L

Though this should be a last resort as it will poll every file it can find.

A little push so OP will see it:

I ran into the same type of error today. Turns out I had errors in my code. Check the github library, pull it and try to run it. If it runs without issues, check your code for typos. This should solve the issue.

1 Like