When I put in
which npm, I get
/usr/local/bin/npm. When I put in
command -v npm, I get
Why is that? What's the difference?
man which says
which "returns the pathnames of the filenames that would be executed in the current environment". I see that if I run
which -a npm, it returns both of the paths mentioned above.
So why does it pick the first one when run without
command -v npm returns the second one?