8

I successfully registered my own library into bower:

bower register angular-ngkit https://github.com/daveoncode/angular-ngkit-bower.git

and I'm able to install it using:

bower install angular-ngkit

But by using simply:

bower install

or

bower info angular-ngkit

I get "No versions available" exception and I don't understand why, since using

git tag

I can see my latest (and only) release named "0.2"

I previously published the library under the name "angular-ngkit" using another git repo and then I unregistered it (using curl -X DELETE repo_url) and re-registered with the new repo url and I also executed the command:

bower cache clean

...so why bower is not working as it should?

UPDATE:

if I define the dependency to my library in bower.json as "angular-ngkit": "*" I'm able to run bower install properly... but it's not acceptable :(

daveoncode
  • 18,900
  • 15
  • 104
  • 159

1 Answers1

7

The reason that Bower does not see any versions of your package is that your repository contains only a single tag - v1.0 - which does not follow semantic versioning.
Bower versions can be Git tags or branches. The version number must be a valid semantic version (semver).
The reason that you manage to install using a star target ("angular-ngkit": "*") is that in this case if there are not valid tags, Bower will fallback to the latest commit on master.

Dror Bereznitsky
  • 20,048
  • 3
  • 48
  • 57
  • 1
    Previously I named the tag 0.1 and the problem was the same... so what should I do? – daveoncode Oct 27 '14 at 15:18
  • 1
    a valid semver version should be in the format of MAJOR.MINOR.PATCH. I suggest looking at semver.org. You can use this nodejs module for validating your version number - https://github.com/npm/node-semver – Dror Bereznitsky Oct 27 '14 at 15:21
  • ok, solved by adding patch version (1.0.0)... I was sure that it was optional, but it's mandatory :P Thank you!! – daveoncode Oct 27 '14 at 15:33