gpt4 book ai didi

bower - 为什么 bower 安装的是最新版本的包,而不是我想要的包?

转载 作者:行者123 更新时间:2023-12-01 14:18:55 30 4
gpt4 key购买 nike

在 bower.json 中有这个

{
"name": "test",
"dependencies": {
"jquery": "2.2.4",
"html5shiv": "3.6.2"
}
}

正在运行

bower install

bower 安装的不是这个版本,而是最新版本(目前为 jquery 3.0.0-rc1 和 html5shiv 3.7.3)。为什么这样?我没有任何其他需要最新版本的依赖项。

这是 bower 安装日志

bower cached https://github.com/jquery/jquery-dist.git#2.2.4
bower validate 2.2.4 against https://github.com/jquery/jquery-dist.git#2.2.4
bower cached https://github.com/aFarkas/html5shiv.git#3.6.2
bower validate 3.6.2 against https://github.com/aFarkas/html5shiv.git#3.6.2
bower install jquery#2.2.4
bower install html5shiv#3.6.2

jquery#2.2.4 bower_components\jquery

html5shiv#3.6.2 bower_components\html5shiv



html5shiv 的 .bower.json 看起来像这样对我来说很奇怪

{
"name": "html5shiv",
"version": "3.6.2",
"main": [
"dist/html5shiv.js"
],
"ignore": [
"**/.*",
"composer.json",
"test",
"build",
"src",
"build.xml"
],
"homepage": "https://github.com/aFarkas/html5shiv",
"_release": "3.6.2",
"_resolution": {
"type": "version",
"tag": "3.6.2",
"commit": "f65f9b0d776ae3b88d4c7f0b27c64e384aee47aa"
},
"_source": "https://github.com/aFarkas/html5shiv.git",
"_target": "3.6.2",
"_originalSource": "html5shiv"
}

但是 bower.json 看起来像这样

{
"name": "html5shiv",
"version": "3.7.3",
"main": [
"dist/html5shiv.js"
],
"ignore": [
"**/.*",
"composer.json",
"test",
"build",
"src",
"build.xml"
]
}

jQuery 也是如此。 .bower.json 引用我想要的版本,但 bower.json 引用最新版本。正如我所说,源文件和 dist 文件来自最新版本。

最佳答案

你应该在版本前使用#例如

{ 
"name": "test",
"dependencies": {
"jquery": "#2.2.4"
}
}

你可以找到more about bower here

关于bower - 为什么 bower 安装的是最新版本的包,而不是我想要的包?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37479383/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com