I am running my nodejs app by npm start
npm start
I just installed nodemon by sudo npm install -g nodemon so that i can get my server restarted when i s
sudo npm install -g nodemon
try
npm install --save-dev nodemon
and then in package.json file keep like this
package.json file
"scripts": { "start": "nodemon", "test": "echo \"Error: no test specified\" && exit 1" },
instead of npx nodemon, which takes more time