代码之家  ›  专栏  ›  技术社区  ›  Ivanka Todorova rmarif

Bower找不到软件包,无法安装新软件包

  •  4
  • Ivanka Todorova rmarif  · 技术社区  · 7 年前

    bower jQuery UI Sortable noty.js 具有 bower install --save noty )我明白了:

    bower noty#*                not-cached https://github.com/needim/noty.git#*
    bower noty#*                   resolve https://github.com/needim/noty.git#*
    bower fullcalendar#*            cached https://github.com/fullcalendar/fullcalendar.git#3.4.0
    bower fullcalendar#*          validate 3.4.0 against https://github.com/fullcalendar/fullcalendar.git#*
    bower noty#*                  download https://github.com/needim/noty/archive/v3.1.1.tar.gz
    bower noty#*                   extract archive.tar.gz
    bower noty#*                  resolved https://github.com/needim/noty.git#3.1.1
    bower                        ENOTFOUND Package jQuery UI Sortable=jquery-ui-sortable not found
    

    :我也尝试安装fullcalendar。

    尽管它说它下载了软件包并提取了 archive.tar.gz jQuery UI可排序 仍然存在。我甚至在用它。

    bower.json 保持不变。如果我跑步 bower安装-save noty 它只是说:

    bower noty#*                    cached https://github.com/needim/noty.git#3.1.1
    bower noty#*                  validate 3.1.1 against https://github.com/needim/noty.git#*
    bower                        ENOTFOUND Package jQuery UI Sortable=jquery-ui-sortable not found
    

    .bowerrc 这指向 resources/assets/bower

    1 回复  |  直到 7 年前
        1
  •  3
  •   Christos Lytras    7 年前

    出现此错误的原因是bower使用 name 构建目录结构并定义包的实际名称。jQuery UI Sortable包使用大写字母和空格定义名称 bower.json

    {
      "name": "jQuery UI Sortable",
      "version": "1.0.0",
      ...
    

    这显然不是一个好主意,在包目录名中使用大写字母和空格:

    jQuery UI Sortable

    jQuery UI Sortable jquery-ui-sortable 去掉空格和大写字母。为此,我们必须使用 <package_installed_name>=<package_list_name> ,在我们的情况下是:

    bower install --save jquery-ui-sortable=jquery-ui-sortable
    

    完成此操作后,只需安装 noty 它应该能够成功安装:

    bower install noty
    

    Bower Noty install

    jQuery UI Sortable and Noty together

    不要忘记删除 在您尝试安装之前,bower packages目录中的目录 jquery ui可排序 使用适当的名称。