I've installed nodemon globally many times but when I try and run it, it doesn't work. This is the error I'm getting:
nodemon : The term 'nodemon' is not recognized as the name of a cmdlet,
or if a path was included, verify that the path is correct and try again.
At line:1 char:1
nodemon server.js
~~~~~~~
CategoryInfo : ObjectNotFound: (nodemon:String) [], CommandN
otFoundException
FullyQualifiedErrorId : CommandNotFoundException
I don't understand why I can't use nodemon when I've installed it globally. I get this error in my VSCode terminal but in my cmd.exe, I get this error:
'nodemon' is not recognized as an internal or external command,
operable program or batch file.
I've tried installing it globally from both the terminal and command prompt. I've also tried deleting node_modules and package-lock.json, and reinstalling them by doing npm install
. I don't understand why this is happening and don't know what to do.
CodePudding user response:
Use npx nodemon
, your environment variables of your OS are probably broken and don't link to where npm global packages get installed.