Nodemon: command not found

I am struggling to install nodemon on my node.js server. I am running the command npm install nodemon -g and the output is the following:

C:\Users\Stoffe\AppData\Roaming\npm\nodemon -> C:\Users\Stoffe\AppData\Roaming\npm\node_modules\nodemon\bin\nodemon.js

> [email protected] postinstall 
C:\Users\Stoffe\AppData\Roaming\npm\node_modules\nodemon
> node bin/postinstall || exit 0

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] 
(node_modules\nodemon\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}                                                                                                                                                                                               )

+ [email protected]
updated 1 package in 9.223s

But the problem is, when I do nodemon index.js, I get the error bash: sudo: command not found. I have searched around without any luck and I am yet to find a working solution. Any help is appreciated!

Upvotes: 0

Views: 1229

Answers (1)

Cody Geisler
Cody Geisler

Reputation: 8617

  1. Don't install global npm modules using the git bash terminal
  2. Reinstall node.js/npm and npm install nodemon -g if where nodemon in cmd prompt returns INFO: Could not find files for the given pattern(s).
  3. If all else fails, ensure that the file is being downloaded and is in your C:\Users\{{YOURUSER}}\AppData\Roaming\npm\nodemon.cmd folder.
  4. Finally, ensure that your windows path environment variable has a folder set to that \AppData\Roaming\npm folder.
  5. If all else fails, you probably have a typo or reached the max path environment variable limit for your operating system (i.e. 4096 characters for windows 7)

Upvotes: 1

Related Questions