# Install nodemon
npm i nodemon
# Write a script like ...
"scripts": {
"start":"nodemon index.js"
}
# Start in your terminal with something like ...
nodemon ./server.js localhost 8000
or
npm run server
// Note: In order to prevent nodemon from automatically restarting your
// application before you've finished updating your code,
// you will need to turn off Autosave on VS Code and remember to save manually.
// Install it globally with the following command:
npm install -g nodemon
# Install nodemon on your project as dev-dependency
npm install nodemon --save-dev
#or
npm i nodemon --save-dev
#nodemon as -dev cause there is no need nodemon in production
// nodemon wraps around the node command.
// To use, it, use nodemon wherever you would normally use the node
// command.
// To use it in the Express server that you just generated,
// you can go to the package.json file inside mynamedServer folder
// and replace this line: "start": "node ./bin/www"
// with this "start": "nodemon ./bin/www"
# when this command doesn't work:
npm install -g nodemon
# Can try
sudo npm install -g nodemon
#It will then ask you to enter the password you use to log on to your computer.
#So, if you have any problems with this step.
#1. Make sure you are logged in to your computer on an account with admin privileges.
#2. Use sudo in front of the installation command.
#3. Type your password when prompted. Note your password typing will not show. Just hit enter once you've typed it all.