3
votes

I am currenlty learning express.js for that purpose i have installed express and nodemon globally so whenever i want to run command nodemon express1.js getting error ,even i have installed this globally and also save express dependencies in package.json file.

installation i did like this

for express  npm install --save express
 for nodemon  npm install -g nodemon 

previoulsy this way installed (npm insatll --save nodemon)

still getting error like this

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

2

2 Answers

1
votes

in cmd type

npm config get prefix 

and hit enter it will show the npm path that path we need to copy and go to mycomputer or in windows10 'This pc' right click on This pc select on properties then ->on left side click on advanced system setting now system properties pop up will open in that select advanced tab and click environment variables and select path from list click on edit and paste that path which is copied but make sure that if any other path is already present use semicolon to end of that path then paste this new path and save . but sometimes if it didn't work then restart your computer because sometimes environment varaible changes will not take effect so restart your system after completing this procedure

1
votes

In your console try nodemon --version if it returns a version then it means nodemon is installed otherwise there might be an error while installing nodemon installing with this command it will install it in your project folder.

npm install --save-dev nodemon