karma command not found when karma already installed

@mayankcpdixit gave the answer up there in a response to the OP's original question, but I'll put it here again in case anyone misses it.

You do not need to uninstall everything, and if I had to manually add a new path link for every npm package I try to install I'd probably shoot myself.

npm install -g karma-cli

Boom. Now you have karma command lines installed. Just like Grunt.


Edit: Please don't forget to upvote @mayankcpdixit as well, he commented directly on the original post, but didn't actually "answer" the question.


In your ~/.bash_profile (or similar) amend your PATH to include npm-installed binaries:

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

I had this very same issue, and found this solution to be less time-consuming and impactful than completely re-installing node.

EDIT this has also worked for others in bash_profile

export PATH="$PATH:/usr/local/lib/node_modules/karma/bin"