Search code examples
node.jsnpmnodemonnpm-scriptsnpm-start

Nodemon for development environment


I wanted to know how to use nodemon, and push it to a git repo, and have other developers on the project be able to use nodemon without having to run the command npm install -g nodemon. Ideally, I would like all developers on the project to be able to just run npm start and nodemon is called whether or not it's installed globally. I've already run npm install --save-dev nodemon, and I'm mostly curious if there is a way to get nodemon to be run from within node_modules, in my start command in the scripts section of the package.json file.


Solution

  • If you install it locally, i.e. without the -g flag, it's available in ./node_modules/.bin/nodemon. So just configure that path in your npm start script.

    For example:

    "start" : "./node_modules/.bin/nodemon app.js"