I am running my nodejs app by npm start
I just installed nodemon by
sudo npm install -g nodemon
so that i can get my server restarted when i s
try
npm install --save-dev nodemon
and then
in
package.json file
keep like this
"scripts": {
"start": "nodemon",
"test": "echo \"Error: no test specified\" && exit 1"
},
instead of npx nodemon, which takes more time
try running nodemon ./app.js 3000 or nodemon start 3000
Use single quotation
for multi-value args like `--exec'.
e.g. I changed "nodemon --exec yarn build-langs"
to "nodemon --exec 'yarn build-langs'"
and worked.
thanks you need to type this after to enter in the folder application with
cd your_project_folder
sudo nodemon bin/www
If you are using express4, the easiest way is to navigate to package.json and change
"scripts": {
"start": "node ./bin/www"
}
to
"scripts": {
"start": "nodemon ./bin/www"
}
For Express.js 4,
use nodemon
or
nodemon bin/www