Bower install: No versions available
Asked Answered
S

1

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 :(

Savina answered 26/10, 2014 at 9:49 Comment(3)
bower info angular-ngkit returns the expected results. Is this question still relevant?Borges
are you sure? it returns "No versions available." at the bottom in my case! :(Savina
You are right, my mistake - missed itBorges
B
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.

Borges answered 27/10, 2014 at 14:2 Comment(3)
Previously I named the tag 0.1 and the problem was the same... so what should I do?Savina
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 - github.com/npm/node-semverBorges
ok, solved by adding patch version (1.0.0)... I was sure that it was optional, but it's mandatory :P Thank you!!Savina

© 2022 - 2024 — McMap. All rights reserved.