所以我在github repo中有一个漂亮的bogstandard bower.json文件:
{
"name": "backbone-iobind",
"description": "Bind socket.io events to backbone models & collections. Also includes a drop-in replacement for Backbone.sync using socket.io.",
"homepage": "https://github.com/soniflow/backbone.iobind",
"keywords": [
"model",
"view",
"controller",
"router",
"server",
"client",
"browser",
"socketio",
"socket",
"iobind"
],
"author": "Noveo Group - Forked by Matt Fletcher",
"repository": {
"type": "git",
"url": "git://https://github.com/soniflow/backbone.iobind.git"
},
"dependencies": {
"backbone": "~1.1.2"
},
"version": "0.4.8",
"main": [
"dist/backbone.iobind.js",
"dist/backbone.iosync.js"
],
"authors": [
"Matt Fletcher <matt@soniflow.com>"
],
"license": "MIT",
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests"
]
}
......我的依赖是直截了当的:
"dependencies": {
"marionette": "~2.0.2",
"backbone-io": "git://github.com/Soniflow/backbone.iobind.git"
}
但是,当我执行bower install
时,它会按原样复制所有文件,但由于某种原因忽略了我的bower.json文件,而是创建一个.bower.json,如下所示:
{
"name": "backbone-io",
"homepage": "https://github.com/Soniflow/backbone.iobind",
"version": "0.4.8",
"_release": "0.4.8",
"_resolution": {
"type": "version",
"tag": "0.4.8",
"commit": "5e06d99d3e79b02bd8a892e3c6ba969e47f49736"
},
"_source": "git://github.com/Soniflow/backbone.iobind.git",
"_target": "*",
"_originalSource": "git://github.com/Soniflow/backbone.iobind.git"
}
...它不包含我的任何元数据,最重要的是,&#34; main&#34;指令。
知道为什么吗?我使用了与骨干本身相同的方法,但似乎工作正常:/
由于
答案 0 :(得分:1)
Bower从Git标签中获取包版本的列表(它们也需要是有效的semver) 在 backbone.iobind 的情况下,最新版本为0.4.8 您可以看到,在解析 backbone.iobind 时,Bower将结帐0.4.8 tag:
bower resolved git://github.com/Soniflow/backbone.iobind.git#0.4.8
但是此标签不包含任何bower.json文件(与主分支不同)。
.bower.json文件是Bower使用的内部文件,不应与bower.json混淆。