nodemon command is not recognized in terminal for node js server

0 votes

I am new to node.js. I am installing npm install nodemon --save. But when I run the server with this nodemon server.js.

In the terminal showing:

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

enter image description here

the node server.js command is working and started the server, But nodemon command is not working.

npm install -g nodemon 
npm install -g nodemon --save 
npm install --save-dev nodemon 
npm install -g nodemon@debug npm install -g --force nodemon


I don't know how to set the path because of my project location in D drive.

I want to run nodemon server.js. If anybody has an idea please share. Thanks in advance.

Feb 17, 2022 in Java by Rahul
• 9,680 points
8,787 views

1 answer to this question.

0 votes

You need to install it globally

npm install -g nodemon # or if using yarn yarn global add nodemon

And then it will be available on the path If you want to use the locally installed version, rather than installing globally then you can create a script in your package.json

"scripts": { 
    "serve": "nodemon server.js" 
},
and then use

npm run serve
optionally if using yarn
# without adding serve in package.json 
yarn run nodemon server.js 
# with serve script in package.json 
yarn run serve

npm will then look in your local node_modules folder before looking for the command in your global modules

To know more about Node JS, It's recommended to join Node JS Certification today.

answered Feb 17, 2022 by Aditya
• 7,680 points

Related Questions In Java

+9 votes
16 answers

Unable to resolve this error: "javac is not recognized as an internal or external command"

Check your javac path on Windows using Windows Explorer C:\Program Files\Java\jdk1.7.0_02\bin and ...READ MORE

answered May 23, 2018 in Java by Rishabh
• 3,620 points
464,544 views
0 votes
1 answer

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

Hey @Paridhi, check this out https://www.edureka.co/community/4800/unable-resolve-error-recognized-internal-external-command This should solve ...READ MORE

answered Apr 20, 2020 in Java by Sirajul
• 59,230 points
1,831 views
0 votes
3 answers

How to check whether a string is empty or not? Is there a function for this?

str != null && str.length() != 0 alternatively str ...READ MORE

answered Sep 11, 2018 in Java by Sushmita
• 6,920 points
1,468 views
0 votes
1 answer

Truffle tests not running after truffle init

This was a bug. They've fixed it. ...READ MORE

answered Sep 11, 2018 in Blockchain by Christine
• 15,790 points
1,947 views
0 votes
1 answer

Hyperledger Sawtooth vs Quorum in concurrency and speed Ask

Summary: Both should provide similar reliability of ...READ MORE

answered Sep 26, 2018 in IoT (Internet of Things) by Upasana
• 8,620 points
1,470 views
0 votes
1 answer

Start script missing error when running npm start

It seems that there is an undefined ...READ MORE

answered Feb 10, 2022 in Java by Soham
• 9,710 points
4,461 views
0 votes
1 answer

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

 While I was solving this problem, the ...READ MORE

answered Feb 17, 2022 in Java by Aditya
• 7,680 points
1,276 views
0 votes
1 answer

jQuery fix for "Uncaught TypeError: $ is not a function" error

 Use the following lines of code in ...READ MORE

answered Feb 16, 2022 in Java by Aditya
• 7,680 points
2,142 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP