简体   繁体   English

为什么凉亭安装包两次?

[英]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.. 当我使用Yeoman(幕后使用Bower)安装软件包时,我看到bower安装每个软件包两次..

  • the first in the root of the project under components folder components文件夹下项目根目录中的第一个
  • the other inside app/components folder 另一个内部app/components文件夹

So for example, when I run the command yeoman install jquery 所以例如,当我运行命令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? 我想最好的做法是从我的应用程序中引用这些组件,并且永远不要改变它们以便我可以轻松更新它们,我是否正确?

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. 这是作为临时hack完成的,因为需要在/ app文件夹中包含组件,因为Bower没有办法指定组件目录。 Now it does, and this will be fixed very soon. 现在确实如此,这很快就会解决。

You can follow the bug here: https://github.com/yeoman/yeoman/issues/622 你可以点击这里的错误: https//github.com/yeoman/yeoman/issues/622

This is fixed now in the 1.0 Beta of Yeoman. 现在修正了Yeoman的1.0 Beta。 http://yeoman.io/road.html 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. 团队已经决定,自耕农应该只做一个项目的设置 ,并将实际的建筑物和依赖性的安装分别留给grunt和bower。

This means that you now do: 这意味着您现在可以:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM