This caught me out after formatting my mac and reinstalling the OS. If you are installing a npm module with a related binary you need to make sure the bin location is in your PATH. It’s easy enough to do this. First you need to find where the npm binaries are located - you can use this npm command to find where the modules are installed:-

 npm root

…the bin folder should be within this folder. Even better than that, the command below will return the path directly to the bin folder:-

 npm bin

So, all that remains is to add this to your PATH statement in the ~/.bash_profile file:-

export PATH=“/path/to/node_modules/.bin:$PATH"

Then re-evaluate your bash profile:-

source ~/.bash_profile

That’s it.