If you get this error, this probably means you either haven't installed nodemon, or it is not on your environment variable called 'Path'. I am assuming you did do npm install -g nodemon
. Otherwise I have no idea what you are doing here. Also, this will be a very in-depth answer
So first, you want to go to your search bar in Windows. Then type; "env".

After, you want to click on "Edit the system environment variables"
. It's self-explanatory, it's the system environment's variables.
Then, you want to click on "Environment Variables." A window will pop up with a lot of things, you want to find the variable called 'Path' in the system variables:

You then want to select it and click "Edit". Then a tab will open up; with the contents of the variable, I am using version 10.0.18363 of Windows, yours might look different then mine. But you want to add a new variable. If you have this variable C:\Users\yourUsername\AppData\Roaming\npm
and nodemon
still doesn't work, you can skip this step. Otherwise you will see other paths listed, just append to it separating with semicolon.
For example, let's say the last path listed is, "C:\Windows\System32". I would add a ";", and then the path to nodemon, so the final result will look like: "C:\Windows\System32;C:\Users\dawoo\AppData\Roaming\npm"
.
After that, you want to click OK
and then OK
again. You should be fine now. If you still have the problem, like I did, you want to right-click on the Windows button, and click: "Windows PowerShell (Admin)"
. You want to copy and paste three things seperately. I pressed "A" for 1 and 2 (Yes to All), this might not work, so try "Yes", which is "Y".
) Set-ExecutionPolicy RemoteSigned
) Set-ExecutionPolicy Unrestricted
) Get-ExecutionPolicy
After you type Get-ExecutionPolicy
, you should get "Unrestricted" or "RemoteSigned", something like that. Now, nodemon should work now! I just wanted to make this Q&A post because I saw lots of people DMing me on Discord saying nodemon doesn't work, and I also wanted to help others who stumbled across this problem. Have a great rest of your day.
Edit: OverFlow didn't save my changes, hopefully you see this but I found out how to fix this problem from one of my friends.