In case you ended up in a situation where you just installed a global NPM module, but it still throws command not found, here’s what you have to do:
Find out where the global NPM modules are installed by running:
npm prefix -g
Double check that your $PATH does not already contain that value:
echo $PATH
If the value is not included, you must update your etc/paths with the NPM location:
sudo vi /etc/paths
Add the value returned by npm prefix -g preceded by /bin
e.g. /Users/catalinmunteanu/.npm-global/bin
Save the file and exit.
Open a new terminal tab/window and retry the command.
Cheers!