To install nodemon globally on Linux, below command:
$ npm install -g nodemon <enter>
will not work as it requires root privileges.
If it is installed with :
$ sudo npm install -g nodemon <enter>
it will install on the local machine in the root folders.
If we do not want to install it globally on our Linux computer, we need to install it locally in our node_modules folder only. To install nodemon on Linux locally without root privileges, open the terminal window and enter the command below:
$ npm i nodemon <enter>
$ npx nodemon server.js <enter>
Now it will work. If code changes in server.js, nodemon will detect the changes and when the route is referenced from a browser, it will show the updated content.