I\'ve started using npm for js package management recently. Although I do have a fair understanding of package management in different enivronments(lets say using apt, rvm/g
While the accepted answer is correct, be aware that there is also npx
which allows to conveniently run local tools.
For more information, see https://blog.npmjs.org/post/162869356040/introducing-npx-an-npm-package-runner
-g
is the global install flag, as explained in this answer. It's covered in detail in this node blog post.
The rules of thumb: