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.