If you're having trouble installing nodemon globally like I was these steps solved it for me.
install npm with the following commands
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install -y nodejs
test your install with
npm -v
install node from NVM and install NVM from here https://github.com/nvm-sh/nvm To install the latest lts version of node run, other versions are available but for most of us the lts is preferable
nvm install --lts
Finally install nodemon like so
npm install -g nodemon
now test nodemon out on something to make sure it's working
if you get an error like
[nodemon] Internal watch failed: ENOSPC: System limit for number of file watchers reached . . .
the problem is that the "max_user_watches" allowed for the user is too low to see your current max_user_watches run the following command
sysctl -a | grep fs.inotify.max_user_watches
in my case the max_user_watches was at
fs.inotify.max_user_watches = 8192
, which was too low you can increase max_user_watches by running the following command
echo fs.inotify.max_user_watches=582222 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
this increase max_user_watches to 582222, which in my case is enough
If you have any questions or you find any errors in this document pleas feel free to reach out, I won't bite :)