bower安装包的存档版本

时间:2015-11-30 09:28:30

标签: javascript node.js npm bower

我在Windows 10上有npm 3.3.6和bower 1.6.8。每当我尝试安装任何软件包(如jquery of framework7)时,它都会下载并安装和存档软件包的版本。参见例如

> bower install jquery --save
bower jquery#*              not-cached git://github.com/jquery/jquery.git#*
bower jquery#*                 resolve git://github.com/jquery/jquery.git#*
bower jquery#*                download https://github.com/jquery/jquery/archive/1.11.3.tar.gz
bower jquery#*                 extract archive.tar.gz
bower jquery#*                resolved git://github.com/jquery/jquery.git#1.11.3
bower jquery#~1.11.3           install jquery#1.11.3

有什么问题?如何安装最新的软件包呢?我试图清理npm和bower缓存,但它没有帮助。

编辑:

您可以看到我的bower.json和安装回复

{
  "name": "test",
  "ignore": [
    "**/.*",
    "node_modules",
    "bower_components",
    "test",
    "tests"
  ],
  "dependencies": {
    "jquery": "~2.1.0"
  }
} 

响应:

bower install
bower jquery#~2.1.0         not-cached git://github.com/jquery/jquery.git#~2.1.0
bower jquery#~2.1.0            resolve git://github.com/jquery/jquery.git#~2.1.0
bower jquery#~2.1.0       ENORESTARGET No tag found that was able to satisfy ~2.1.0

Additional error details:
Available versions in git://github.com/jquery/jquery.git: 1.11.3, 1.11.2, 1.11.1, 1.11.1-rc2, 1.11.1-rc1, 1.11.1-beta1, 1.11.0, 1.11.0-rc1, 1.11.0-beta3, 1.11.0-beta2, 1.11.0-beta1, 1.10.2, 1.10.1, 1.10.0, 1.10.0-beta1, 1.4.4, 1.4.3, 1.4.2, 1.4.1, 1.4.0, 1.3.2, 1.3.1, 1.3.0, 1.2.6, 1.2.5, 1.2.4, 1.2.3, 1.2.2, 1.2.1, 1.1.4, 1.1.3, 1.1.2, 1.1.1, 1.0.4, 1.0.3, 1.0.2, 1.0.1

2 个答案:

答案 0 :(得分:0)

bower.json

中设置此项
"jquery": "~2.1.0",

这将从jQuery系列2.1.x(目前为2.1.4)中获取最新信息。

如果您需要其他系列,可以相应更改。如果您需要精确版本,只需从头开始删除波浪号。

顺便说一句,jQuery 1.11.3是jQuery系列1.x.x的最新版本。

答案 1 :(得分:0)

"jquery": "~2",中尝试bower.json这将从主要版本2开始安装最新的次要版本

相关问题