Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I can´t install nodemon globally, "nodemon" not recognized

I want to use nodemon for monitoring my node.js app's, then I execute the next line command:

npm install -g nodemon  

or

npm install nodemon -g 

When I move to my app folder and try to to

nodemon app.js 

The system tells to the next:

"nodemon 'is not recognized as an internal or external command, program or batch file.

like image 598
RMontes13 Avatar asked Jul 31 '13 16:07

RMontes13


People also ask

Why Nodemon is not getting installed?

Use npx to solve the error "'nodemon' is not recognized as an internal or external command, operable program or batch file", e.g. npx nodemon server. js or install the package globally by running npm install -g nodemon and make sure your PATH environment variable is set up correctly.

How do I install Nodemon globally?

To install it globally, run "npm install --global nodemon" . And Nodemon will be installed on your system path, and you will be able to use the "nodemon" command directly on the command line.


1 Answers

Since node prefix is not in the PATH ENV variable , any of the globally installed modules are not getting recognized.

Please try this.

Open cmd prompt

npm config get prefix

append the resulting path to PATH env variable.

Now you should be able to run nodemon from any location.


This is what i have done on my local machine


C:\>npm config get prefix C:\Users\username\AppData\Roaming\npm  C:\>set PATH=%PATH%;C:\Users\username\AppData\Roaming\npm;  C:\>nodemon  31 Jul 22:30:29 - [nodemon] v0.7.8  31 Jul 22:30:29 - [nodemon] to restart at any time, enter `rs`  31 Jul 22:30:29 - [nodemon] watching: C:\  31 Jul 22:30:29 - [nodemon] starting `node `  ^CTerminate batch job (Y/N)? Y 
like image 115
Chandu Avatar answered Oct 11 '22 18:10

Chandu