Nodemon giving an issue

Viewed 42
  1. I installed nodemon.
  2. I made changes to my code.
  3. It is stuck at RESTARTING DUE TO CHANGES and doesn't restart the server.

Why is this happening and how to solve it?

Screenshot is given.

>>index.js
const express = require('express');

const app = express();

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

app.get('./help', (req, res) => {
    res.send('Help Page!');
})

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

app.listen(port, () => {
    console.log(`Server is listening on ${port}`);
});



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

The problem is with the latest version of the nodemon. The previous or older version runs completely fine without making any issue i.e. nodemon@2.0.7.

Related