【问题标题】:Why does bower install packages twice?为什么 bower 安装包两次?
【发布时间】:2012-11-16 16:21:09
【问题描述】:

当我使用 Yeoman(在幕后使用 Bower)安装包时,我看到 bower 将每个包安装了两次..

  • 项目根目录下的第一个components文件夹
  • app/components 文件夹中的另一个

例如,当我运行命令yeoman install jquery

我的项目目录将如下所示

 root-directory
 |- app
 .  |- components
 .  .  |- jquery        // <<-- jquery  
 .  .  ... rest of the components
 |- components
 .  |- jquery           // <<-- jquery ... again
 .  ... same other components
  • 为什么每个组件都有一个副本,我应该使用哪一个?
  • 我想最佳做法是从我的应用程序中引用这些组件,并且永远不要更改它们以便我可以轻松更新它们,对吗?

【问题讨论】:

  • 这实际上是包的两个独立副本,还是一个指向另一个的符号链接?
  • 两个独立但相同的副本..

标签: javascript node.js npm yeoman bower


【解决方案1】:

这是作为临时 hack 完成的,因为 /app 文件夹中需要有组件,因为 Bower 无法指定组件目录。现在可以了,而且很快就会解决。

您可以在此处关注错误:https://github.com/yeoman/yeoman/issues/622

【讨论】:

    【解决方案2】:

    此问题现已在 Yeoman 1.0 Beta 中得到修复。 http://yeoman.io/road.html

    团队决定 yeoman 应该只进行项目的设置,而将依赖项的实际构建和安装分别交给 grunt 和 bower。

    这意味着你现在这样做:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-05-26
      • 2015-12-23
      • 1970-01-01
      • 2014-07-05
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多