npm jshint – command not found after install
Oct 21, 2012
1 minute read

I was getting a new machine up and running and decided to play with zsh. Later that evening I was going to write some JavaScript and wanted to lint my code with the handy jshint tool. So I installed it with NPM:

$ npm install jshint -g

And was then greeted with a command not found error:

$ jshint
zsh: correct jslint to slit [nyae]? n
zsh: command not found: jslint

Turns out I needed to add the npm bin directory to my PATH, as it didn’t get added there automatically since I installed zsh after node/npm.

export PATH="/usr/local/share/npm/bin:${PATH}"