admin管理员组

文章数量:1297124

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 ponents folder
  • the other inside app/ponents folder

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

my project directory will look like this

 root-directory
 |- app
 .  |- ponents
 .  .  |- jquery        // <<-- jquery  
 .  .  ... rest of the ponents
 |- ponents
 .  |- jquery           // <<-- jquery ... again
 .  ... same other ponents
  • Why I have a duplicate to each ponent, and which one should I use?
  • I guess the best practice is to reference those ponents from my app, and never alter them so I can update them easily, am I correct?

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 ponents folder
  • the other inside app/ponents folder

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

my project directory will look like this

 root-directory
 |- app
 .  |- ponents
 .  .  |- jquery        // <<-- jquery  
 .  .  ... rest of the ponents
 |- ponents
 .  |- jquery           // <<-- jquery ... again
 .  ... same other ponents
  • Why I have a duplicate to each ponent, and which one should I use?
  • I guess the best practice is to reference those ponents from my app, and never alter them so I can update them easily, am I correct?
Share Improve this question edited Nov 28, 2012 at 19:12 saintedlama 6,8981 gold badge30 silver badges47 bronze badges asked Nov 28, 2012 at 17:57 Anas NakawaAnas Nakawa 2,0151 gold badge24 silver badges43 bronze badges 2
  • Are these actually two separate copies of the package, or is one a symlink pointing to the other? – ruakh Commented Nov 30, 2012 at 22:31
  • two separate but identical copies.. – Anas Nakawa Commented Dec 1, 2012 at 7:53
Add a ment  | 

2 Answers 2

Reset to default 11 +50

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

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

This is fixed now in the 1.0 Beta of Yeoman. http://yeoman.io/road.html

The team have decided that yeoman should just do the setup of a project, and leave the actual building and installing of dependencies to grunt and bower respectively.

This means that you now do:

$ yo init
... setup
$ npm install
... get node modules
$ bower install
... get bower ponents
$ grunt server
... run the server

本文标签: javascriptWhy does bower install packages twiceStack Overflow