nodemon: Nodemon stuck at "[nodemon] restarting due to changes"

  • nodemon -v: 2.0.12
  • node -v: 14.17.6
  • Operating system/terminal environment: Laptop/VS Codeterminal
  • Using Docker? What image:
  • Command you ran:
//index.js
const express = require('express');

const app = express();

app.get('', (req, res) => {
    res.send('Hello, world!');
})

const port = 3000;
const hostName = '127.0.0.1';

app.listen(port, hostName, () => {
    console.log(`The server is listening on ${hostName}:${port}`);
})

package.json

{
  "name": "app",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "watch": "nodemon",
    "start": "index.js"
  },
  "author": "Sharjeel",
  "license": "ISC",
  "dependencies": {
    "express": "^4.17.1"
  },
  "devDependencies": {
    "nodemon": "^2.0.12"
  }
}

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 2
  • Comments: 25 (3 by maintainers)

Commits related to this issue

Most upvoted comments

I’ve solved the problem by not installing the latest nodemon version but the old one i.e. nodemon@2.0.7 Use npm install nodemon@2.0.7 -g (to install it globally) npm install nodemon@2.0.7 (to install it locally)

The issue is solved. Just use version 2.0.7 of nodemon.

this solution works for me: https://www.youtube.com/watch?v=a9fIZViTNEA&ab_channel=TechTalkNetwork just follow what is on the video even if you don’t understand the language.

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.

Works 100%. Tested it about 50 times, restarted all the time (Windows) with 2.0.14 and 2.0.14-alpha.1

Tested also 2.0.12 again and also 2.0.13 and run into problems.

@immortalmind2016 great, thanks for this fix!

@remy 2.0.14 is live @ latest since a few minutes. You could close this issue.

Oh my god, I am gonna kill myself.

After installing nodemon I was trying to run this

npm start

And it is actull should be

nodemon index.js

I’ve had this issue for quite some time and I encounter this everyday, I’ll be using this v of nodemon for the next 4 days and update what happens.

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.

Let’s keep this open until the fix is actually live (for others with the same issue to prevent dupes).