I am trying to automate the server reload using the nodemon. I have it installed locally and have the start set to
nodemon app.js
using the code:
"scripts": { "start": "nodemon app.js" }
It ran fine for the first time, but after shutting down the system once and reopening my project, it does not seem to run properly anymore. Now it throws an error every time I use the command nodemon app.js
.
The error line is:
nodemon: The term 'nodemon' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
The best solution I could go about this is:
npm install -D nodemon // install as a dev dependency
npm start // run script start
Below are some solutions
npm install -g nodemon
after that you have to run this command: npm run dev
here dev is (script) server name
npm config get prefix
in output you will get PATH and then past this path in to the Environment Variables and it solved
Restart the terminal and run this command
nodemon run dev
I hope after that it will work properly:)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.