According to Betteridge’s law, the answer should be NO but this time I will surprise everyone with a nice it depends :).

A modern JavaScript webapp may require a number of tools such as package managers (npm, bower), generators (Yeoman), build systems (gulp, grunt), that have a command-line interface. Most (all?) of them suggest to install them globally: for example with if you go to Yeoman’s website, on the landing page you will find a “One-line install using npm: npm install -g yo”. It is not the only one.

If a tool is is used by your build though, you should install it locally to the project.

Why ?

Your project depends on them

JavaScript software in general is evolving at a very fast pace; APIs change and sometimes bugs appears (luckily sometimes they get fixed too :) ). If you’re working in a team and your colleagues have a different version of the tools, the result of the build may be different, and it is something that you want to avoid (even more if you use Continuous Integration or Continuous Delivery).

Your project should have a dependency on a specific version of those tools; this will ensure first that everybody will have all the tools necessary and second that they have the right version.

Not every project needs the same version of the same tool

If you ever tried to make the right version of sass, compass, bootstrap-sass and gulp-sass work together, you know what I’m talking about :). If you need a specific version for a given project, you’ll have more luck by installing locally

The approach i use is quite simple

First of all, I only install globally npm and node.js

I install everything else with npm. If it is a frontend project, even bower is installed with a

npm install --save-dev bower

Since binaries are installed usually under node_modules/.bin, when I’m working in a unix environment I prepare a few handy shell aliases like

alias bower=./node_modules/.bin/bower

This way when I’m checking out a new project from version control, I just need a

npm install

and I am ready to go.