Soccerball123
Soccerball123

Reputation: 869

Unsure why nodemon isn't working, tried all solutions

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.

Upvotes: 0

Views: 1711

Answers (3)

Keith Woodward
Keith Woodward

Reputation: 1

Interestingly under RHEL8.9 and NodeJS v12.22.0, I use npm to start my client and server instances. There is an operator for npm called stop but it fails in a missing script error each time. Based on your blog here, npx does work normally with npx stop server, for one example. However, nodemon is still resident in memory and ports are still being enabled for nodeman.

Upvotes: 0

syed iftaqar
syed iftaqar

Reputation: 9

your npm that module does not support or is not compatible with Nodemon so try to use

npx

instead of

npm

Upvotes: 0

Scar
Scar

Reputation: 364

Use npx nodemon, your environment variables of your OS are probably broken and don't link to where npm global packages get installed.

Upvotes: 1

Related Questions