简体   繁体   English

凉亭注册新版本

[英]bower register new version

I register a version of my "angular-backstrech-adrr" to bower: 我向凉亭注册了一个版本的“angular-backstrech-adrr”:

bower register angular-backstrech-adrr git@github.com:AladdinMhaimeed/angular-backstrech-adrr.git

this is bower.json: 这是bower.json:

{
  "author": "Aladdin Mhaimeed",
  "name": "angular-backstrech-adrr",
  "version": "1.0.4",
  "main": "angular-backstretch.js",
  "dependencies": {
          "jquery": ">2.0.0",
          "jquery-backstretch": "https://raw.github.com/srobbin/jquery-backstretch/master/jquery.backstretch.min.js"
  }

} }

Bower says it is successfully registered, but when I use: Bower说它已经成功注册,但是当我使用时:

bower info angular-backstretch-adrr 

It says there is no version available. 它说没有可用的版本。

If I change the version and try to register again, I get: EDUPLICATE 如果我更改版本并尝试再次注册,我会得到: EDUPLICATE

Is there something wrong in the bower.json? bower.json有什么问题吗? Anything wrong with the syntax? 语法有什么问题吗?

Your package only needs to be registered once. 您的包只需要注册一次。 The versions are drawn from your Git tags. 版本是从您的Git标签中提取的。 From the Bower documentation : 从Bower 文档

Your package must be available at a Git endpoint (eg, GitHub); 您的包必须在Git端点可用(例如,GitHub); remember to push your Git tags! 记得推你的Git标签!

Not to worry, I had no idea what this meant either. 不用担心,我也不知道这意味着什么。 After poking around a bit, I stumbled across this . 经过一番探索后,我偶然发现了这一点

Here's the quick and easy way to solve your problem... from your project's root directory run: 这是解决问题的快捷方法......从项目的根目录运行:

% git tag v1.0.4

If you type: 如果输入:

% git tag

you'll see the version you just created. 你会看到你刚刚创建的版本。 Now push your Git tags: 现在推送你的Git标签:

% git push origin v1.0.4

Now when you run bower info angular-backstretch-adrr , you'll see the version you just pushed. 现在,当您运行bower info angular-backstretch-adrr ,您将看到刚刚推送的版本。

Above answer is correct except v in front of version is incorrect. 以上答案是正确的,除了版本前面的v不正确。

//Incorrect
% git tag v1.0.4

//Correct
% git tag 1.0.4

Now push it. 现在推它。 Github also complains when try to put v in front of tag. 当尝试将v放在标签前时,Github也会抱怨。

Live log of bower 凉亭的实时日志

bower not-cached    git://github.com/speedovation/Inventive.git#*
bower resolve       git://github.com/speedovation/Inventive.git#*
bower download      https://github.com/speedovation/Inventive/archive/0.9.6.tar.gz
bower progress      inventive#* received 0.4MB
bower progress      inventive#* received 0.5MB

See 0.9.6 in log. 见日志中的0.9.6。 If v used it will fail. 如果v使用它将失败。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM