xxxxxxxxxx
Solution-3 Path Variable is not setup correctly
If you have installed the nodemon globally and still getting the error of "nodemon command not found". Then try to set up the path variable of npm. Although it is set up by default during npm installation, sometimes any other package can conflict and can mess up with system variables.
Open control panel > search for envrionment variables
Click on Edit environment variable
Go to Advance tab > Select environment variable
Create a new variable with name NPM in variable name and complete path of nodemon installation (C:\users\AppData\Roaming\npm). In my case it is C:\users\Devender\AppData\Roaming\npm as shown in the image.
Add npm variable to Path variables
Close command prompt and re-open
Type nodemon --version command. It should show your the nodemon version
xxxxxxxxxx
//This happens because nodemon is not installed globally on your machine
//solution
npm install -g nodemon
xxxxxxxxxx
sudo npm install nodemon -g
// This command will install nodemon into the system
xxxxxxxxxx
// Installing globally should do the trick if you get 'command not found' error //
npm install -g nodemon --save-dev
xxxxxxxxxx
npm uninstall nodemon
sudo npm uninstall -g nodemon
sudo npm install -g --force nodemon
xxxxxxxxxx
npx nodemon server.js
or add in package.json config:
"scripts": {
"dev": "npx nodemon server.js"
},
then run:
npm run dev
xxxxxxxxxx
nodemon command not foundWhatever By Mysterious Monkey on May 16 2020
npx nodemon server.js
or add in package.json config:
"scripts": {
"dev": "npx nodemon server.js"
},
then run:
npm run dev