Languages

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

0 points
Asked by:
Gigadude
791

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:
Gigadude
791

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
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
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.

❤️💻 🙂

Join