Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bower and grunt globally or locally?

We have nvm not to install anything globally because we may work on many different projects at the same time that requires different versions of the same libraries. But what about bower and grunt? Everywhere in the Internet I see npm install -g bower I know that grunt some time ago split into grunt and grunt-cli that should make the global package more stable. But what about bower?

What are the best practices for working with such packages? How to avoid potential versions conflict? Or maybe I exaggerate the problem and I should simply use the -g option?

like image 561
piotrek Avatar asked Feb 16 '15 14:02

piotrek


1 Answers

Spoiler - globally.

Bower and grunt are development tools -

Bower is used among every frontend development procedure so using it as a local package is just wrong.

Grunt split into grunt and grunt-cli, the purpose is to give you the runnable abilities of grunt packed in grunt-cli while the code module is packed in grunt and can be installed locally - but, you will find yourself using it in other projects and installing it locally several times.

To make a long story short, it's best to install the following packages globally:

  1. development tools
  2. non-production packages
  3. shared packages that are installed globally on your hosting server - for example, you can have express installed globally and use it within all other projects, but you must ensure it's global on your server (mention that in your package.json).
like image 59
Ben Diamant Avatar answered Sep 19 '22 10:09

Ben Diamant