1

I have been using nodemon for past few months now. It's just that today I got this error. I tried uninstalling nodemon and the reinstalled it. I also forced install it. Nothing worked. Whenever I run the nodemon command

bash: nodemon: command not found

pops up.

There are other answers too and I have looked them all up. They haven't worked for me.

Ankur Chavda
  • 173
  • 4
  • 17

3 Answers3

7

I have faced this error once, and in my package.json, I updated the nodemon location and it worked.

Below code is in my package.json

"start" : "./node_modules/.bin/nodemon server.js"

and then after running npm start it works.

Anurag Singh Bisht
  • 2,683
  • 4
  • 20
  • 26
  • I am looking for a permanent solution. In this case, I will have to edit all the package.json files. – Ankur Chavda Aug 04 '17 at 10:10
  • This is a permanent solution, as you should refer to `nodemon` from your modules, as other people who might do installation using your `package.json` might not have it installed globally. – Anurag Singh Bisht Aug 04 '17 at 10:19
3

If you don't have nodemon installed globally try to do that. I had the same issue but after installing it globally whenever I ran the command it work

sudo npm install -g nodemon

I hope this will help

Novinyo Amegadje
  • 699
  • 4
  • 11
0

This is down to your global variables.

Ensure npm is included in your PATH var and there is no conflicting npm directories

echo %PATH%

If it is, get your npm root, Ensure the npm in your global path matches the npm root

npm root -g

Navigate there and ensure the "nodemon" file is there. This is where all the npm install -g files are installed. If not run npm i nodemon -g and confirm that it has been added to the npm root folder.

Having all of these boxes ticked will get these globals are working for you again.

Gearoid
  • 173
  • 2
  • 7