Why "bower" as dependency in "package.json"?

I noticed that you install bower as npm module in package.json. If I already have installed the bower CLI globally, what’s the reason to install it as local module?

Roots uses Bower locally to manage each project independently. More here: http://roots.io/roots-7-0-0-updates/

Hi @cfx
I have read the link but it doesn’t explain a lot and I’m not sure to understand. Also, in roots github here it says to install bower globally. :confused:

So, if I have already installed bower globally (npm install -g bower) I don’t need to install bower in package.json. Right? Please, let me know. Thanks

You’re not installing Bower twice. You install it once (globally) and then Roots runs Bower’s install task which installs the dependencies specified in bower.json.


  1. I downloaded roots theme
  2. removed the “bower” line from devDependencies in package.json
  3. launched npm install
  4. launched bower install
  5. launched grunt (for first compilation)
  6. all works

Conclusion: I don’t need to install bower as npm module. Am I wrong?

You are not wrong, but strictly speaking I would not call that approach pragmatic. You will see an error message generated by the npm post install script unless you remove its Bower reference.