I have install nodemon as dev-dependency.
I made a script "devserver": "./node_modules/nodemon/bin/nodemon.js index.js"
but when I run npm run devserver
it is giving error '.' is not recognized as an internal or external command
.
Please help.
To install it globally, run "npm install --global nodemon" . And Nodemon will be installed on your system path, and you will be able to use the "nodemon" command directly on the command line.
Configure your your devserver script as following,
"devserver": "nodemon index.js"
Or
"devserver": "./node_modules/.bin/nodemon server.js"
nodemon will be recognized in current project, if its installed
Add "nodemon index.js" to your "start" script of package.json. Ex.
"scripts": { "start": "nodemon index.js" }
And then use "npm start" to start using nodemon
you want to serve index.js
with nodemon so use nodemon at the start of command.
You dont have to trace the path of nodemon in node modules, after you install it in the project.
"devserver": "nodemon index.js"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With