首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Bower找不到软件包,也无法安装新的软件包。

Bower找不到软件包,也无法安装新的软件包。
EN

Stack Overflow用户
提问于 2017-07-19 10:04:44
回答 1查看 1.6K关注 0票数 4

所以我是通过bower - jQuery UI Sortable安装的。包的文件夹如出一辙地放在“我的资产”文件夹中。然后,我想安装另一个软件包(例如:noty.jsbower install --save noty),我得到了以下信息:

代码语言:javascript
复制
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

Note__:我也尝试过安装完整日历。

尽管它说它下载了包并提取了archive.tar.gz,但是在我的项目的文件夹中找不到这个包。jQuery UI Sortable还在。我甚至在用它。

bower.json没有被碰过。如果我运行bower install --save noty,它只会说:

代码语言:javascript
复制
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

我有一个指向.bowerrcresources/assets/bower (因为它是一个Laravel项目)。那我该怎么解决这个问题?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-07-26 14:42:14

造成此错误的原因是,bower使用name构建目录结构并定义包的实际名称。jQuery UI可排序包在bower.json文件中使用大写字母和空格定义名称,如下所示:

代码语言:javascript
复制
{
  "name": "jQuery UI Sortable",
  "version": "1.0.0",
  ...

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

因此,我们需要将名称从jQuery UI Sortable更改为jquery-ui-sortable,去掉空格和大写字母。要做到这一点,我们必须使用<package_installed_name>=<package_list_name>来定义名称,在我们的例子中,这将是:

代码语言:javascript
复制
bower install --save jquery-ui-sortable=jquery-ui-sortable

完成此操作后,只需安装noty,它将成功安装它:

代码语言:javascript
复制
bower install noty

在尝试安装具有正确名称的jQuery UI Sortable之前,不要忘记删除bower目录中的jquery-ui-sortable目录。

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/45187298

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档