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.

3

3 Answers 3

8

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.

Sign up to request clarification or add additional context in comments.

2 Comments

I am looking for a permanent solution. In this case, I will have to edit all the package.json files.
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.
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

Comments

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.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.