Search code examples
node.jsbashnpmgit-bashnodemon

Nodemon [filename.js] returns bash: nodemon: command not found


I can't get nodemon running. I've tried installing it with npm install -g nodemon and npm install nodemon --save-dev. When I run npm list -g --depth=0 it shows nodemon is installed. But for the life of me, can't get it to work. Any help please?


Solution

  • Turns out I had to go into my Path and set the route for my npms.

    Here's how you do it:

    1. Find your path for nodemon (or any npm) in nodemons case you can type where nodemon this will give you the file location. Mine was C:\Users\rmcgu\AppData\Roaming\npm\nodemon copy that file path.

    2. Search windows for system and then advanced system settings.

    3. This opens a new window called system properties. From here click on the advanced tab and then Environment Variables...

    4. Then under User variables for username, there will be a few options. In my case, OneDrive, Path, Temp and TMP. Click path and then edit...

    5. On the new window (Edit environment variable) click new and past your previously copied file path in, but remove anything after \npm So for example C:\Users\rmcgu\AppData\Roaming\npm\nodemon becomes C:\Users\rmcgu\AppData\Roaming\npm

    Hopefully this helps someone else out. I had C:\Users\rmcgu\AppData\Roaming\npm\nodemon set in my path, but not the npm directory itself.