1

I have installed globally the nodemon module (version 1.11.0).

The installation was successful and the package exists in the global modules list, but the nodemon command returns the following error in Powershell:

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
+ ~~~~~~~
    + CategoryInfo          : ObjectNotFound: (nodemon:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

This happens when I try to run commands from other globally installed modules, so It seems there is a path error.

The user variable with name PATH has the value:

C:\Program Files\nodejs;C:\Users\Cal\AppData\Roaming\npm\node_modules;C:\Program Files\MongoDB\Server\3.4\bin

Is my diagnosis correct, and if so, where am I going wrong?

Callum
  • 315
  • 4
  • 18
  • Which of those paths holds the nodemon executable? Does browsing to the path and running nodemon work? Does running `. nodemon` and `& nodemon` give the same result? – twglomski Jan 31 '17 at 22:13
  • I tried both commands on both paths and the error from the OP was returned in each case. The nodemon directory is located at the C:\Users\Cal\AppData\Roaming\npm\node_modules path. – Callum Jan 31 '17 at 22:30
  • Does this command work: `. C:\Users\Cal\AppData\Roaming\npm\node_modules\nodemon` – twglomski Feb 01 '17 at 01:11
  • what is the command that you are trying? Post it as a whole. – Ranadip Dutta Feb 01 '17 at 02:54
  • After the `Path` variable is updated in the registry, this change is not reflected to open PowerShell instances. You will have to close and reopen your PowerShell instance. – Bill_Stewart Feb 01 '17 at 18:38
  • Possible duplicate of [npm install doesn't work in Windows PowerShell](https://stackoverflow.com/questions/19569990/npm-install-doesnt-work-in-windows-powershell) – Paul Sweatte Sep 11 '17 at 18:15
  • Try to add to your path `%userprofile%\AppData\Roaming\npm` without the trailing `node_modules`, as suggested [here](https://stackoverflow.com/questions/55007252/the-term-msbot-is-not-recognized-as-the-name-of-a-cmdlet-function-script-fil), it worked for me like a charm. – joanlofe Jun 05 '19 at 10:20
  • I can confirm that @twglomski 's solution works on Windows 10! Simply add a new system variable: `C:\Users\{username}\AppData\Roaming\npm\node_modules\nodemon` Where {username} is the account name of your computer. Then **restart** your console/IDE and retry the command. – lbragile Aug 15 '20 at 21:11

0 Answers0