-1

enven if i install modemon globaly same king of error came.

i was expecting this.

nodemon : The term 'nodemon' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1

  • nodemon .\index.js
  •   + CategoryInfo          : ObjectNotFound: (nodemon:String) [], CommandNotFoundException
      + FullyQualifiedErrorId : CommandNotFoundException
    

1 Answers1

-1

use cmd and not powershel. if didnt help - make sure you're running the nodemon command in the server folder and not on the client. if still no - put the command inside the package.json file, under the scripts section, then run the script. like -"start":"nodemon index.js" then to run it - make anpm run start command instead of nodemon index

Yosi Leibman
  • 386
  • 3
  • 16
  • What difference would it make if one used `cmd` instead of `powershell`? And if nodemon isn't installed globally, it's more or less irrelevant where you try to execute it ... – derpirscher Mar 19 '23 at 10:05
  • Thanks for asking. CMD has a different scope, which nodemon never worked for me on Powershell but did work on CMD/bash. About the script - when you have issue with npm cache and it doesn't finds your global install - you still can run npm scripts that do get access to the files (and in case that's installed locally only - this is the only way to run it) – Yosi Leibman Mar 19 '23 at 15:02