'nodemon' is not recognized

2

After installing the nodemon I get the following error:

  

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

The following commands have been passed:

  • npm install -g nodemon
  • npm install --save-dev nodemon
asked by anonymous 08.05.2018 / 13:53

3 answers

2
npm install -g nodemon

npm install --save-dev nodemon

npm config get prefix

set PATH=%PATH%;C:\Users\"Aqui seu usuario"\AppData\Roaming\npm;

I found this solution on this site link as soon as possible use the command:

  • nodemon server
08.05.2018 / 14:24
1

When you are going to execute some command from a node library, you do not execute the library directly, but by the node, by the command:

npm run <comando no package.json>

In this case, with the nodemon you would use the command below:

npm run nodemon

Although, if configured in package.json, you can use the defined name there. In my case, I have a command set in my package.json like this:

"scripts": {
  "start": "ng serve"
}

I could use it directly as npm ng serve or use npm run start .

    
08.05.2018 / 14:02
0

The command you must perform for nodemon to recognize your server is:

nodemon SeuArquivoDeServidor.js

You can see in this tutorial here .

You can also specify in your package.json file

It will look something like:

"scripts": {
  "start": "nodemon SeuArquivoDeServidor.js"
}

Then you just need to run the command on the terminal

npm start

You can read more about the nodemon package page here and the nodemon's own documentation here .

I hope this has helped you.

    
08.05.2018 / 15:39