Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does bower install packages twice?

When I install packages using Yeoman (which behind the scenes uses Bower), I see that bower installs each package twice..

  • the first in the root of the project under components folder
  • the other inside app/components folder

So for example, when I run the command yeoman install jquery

my project directory will look like this

 root-directory
 |- app
 .  |- components
 .  .  |- jquery        // <<-- jquery  
 .  .  ... rest of the components
 |- components
 .  |- jquery           // <<-- jquery ... again
 .  ... same other components
  • Why I have a duplicate to each component, and which one should I use?
  • I guess the best practice is to reference those components from my app, and never alter them so I can update them easily, am I correct?
like image 598
Anas Nakawa Avatar asked Nov 28 '12 17:11

Anas Nakawa


People also ask

Where does bower install packages?

Installed packages will be placed in a bower_components directory. This is created in the folder which the bower program was executed. You can change this destination using the configuration options in a . bowerrc file.

What does bower install do?

Bower doesn't concatenate or minify code or do anything else - it just installs the right versions of the packages you need and their dependencies. To get started, Bower works by fetching and installing packages from all over, taking care of hunting, finding, downloading, and saving the stuff you're looking for.

What is bower in jQuery?

Bower is a package manager for the Web. You can use Bower to download libraries like jQuery UI from the command line, without having to manually download each project from their respective sites.


1 Answers

This was done as a temporary hack because of the need to have components in the /app folder, since Bower didn't have a way to specify the component directory. Now it does, and this will be fixed very soon.

You can follow the bug here: https://github.com/yeoman/yeoman/issues/622

like image 84
Sindre Sorhus Avatar answered Oct 22 '22 07:10

Sindre Sorhus