简体   繁体   中英

bash: nodemon: command not found

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.

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.

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM