Node.js - 'nodemon' is not recognized as an internal or external command

0 points
Asked by:

I've just installed nodemon for my Node.js server and I cannot run it using nodemon index.js. Do you know how to run my index.js file with nodemon?

Error message:

'nodemon' is not recognized as an internal or external command,
operable program or batch file.
1 answer
3 points
Answered by:

I found the solution:

I installed nodemon locally and this command works only if the nodemon was installed globally.

For the locally installed nodemon I inserted it into "scripts" inside the package.json file like this:

  "scripts": {
    "start": "nodemon index.js"

and I run the index.js file using:

npm start


Second solution is to install nodemon globally with npm:

npm install -g nodemon

or Yarn:

yarn global add nodemon
0 comments Add comment
Native Advertising
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂