Stack Exchange
can't find nodemon\bin\nodemon.js - nodemon is not working
package.json
  "description": "",
  "main": "index.js",
  "scripts": {
    "start" : "nodemon app.js",
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "dependencies": {
    "express": "^4.17.2"
  },
  "devDependencies": {
    "nodemon": "^2.0.15"
  }
}

app.js
const express = require('express')

const app = express()
const port = 5000

app.listen(port, () => console.log(`Listening to port ${port}`))

error
PS F:\Nodejs & ESJ\news-app> npm start   

> news-app@1.0.0 start
> nodemon app.js

'ESJ\news-app\node_modules\.bin\' is not recognized as an internal or external command,
operable program or batch file.
internal/modules/cjs/loader.js:883
  throw err;
  ^

Error: Cannot find module 'F:\nodemon\bin\nodemon.js'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
    at Function.Module._load (internal/modules/cjs/loader.js:725:27)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
    at internal/main/run_main_module.js:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []

when I run npm start it's giving the above-given error but if I changed the script like this
"start" : "node app.js" it's working properly. I checked with all the possible ways to overcome this but could not solve this.

I think it can be because of the windows, try to install nodemon separately as a global module

npm i nodemon -g

ya I have seen many suggesting installing nodemon globally but is that the only way to fix this
