nodemon is not recognized code example

Example 1: nodemon : The term 'nodemon' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1 + nodemon index

npm install -g nodemon --save

Example 2: nodemon: command not found

sudo npm install nodemon -g
// This command will install nodemon into the system

Example 3: nodemon is not recognized

//You need to install nodemon as globally. Use this command
npm install -g nodemon
//Now you can use nodemon it will work

Example 4: nodemon command not found

npx nodemon server.js
or add in package.json config:

...
"scripts": {
    "dev": "npx nodemon server.js"
  },
...
then run:

npm run dev

Example 5: nodemon: command not found

...
"scripts": {
    "dev": "npx nodemon server.js"
  },
...

Example 6: 'nodemon' is not recognized as an internal or external command, operable program or batch file.

Run: $ npm install -g nodemon

Run: $ npm install --save-dev nodemon

Change package.json file as:

"scripts": {
    "serve": "nodemon index.js"
}
Run: $ npm run serve