robin
robin

Reputation: 1925

Bower not taking the latest version

In my project I have created some bower components, which I am using in my bower.json file of main app like below.

"My-Component": "1.0.12"

It was working fine too. Now i created a newer version of My-Component and updated the bower.json file like below.

"My-Component": "1.0.13"

When i do bower install the new version is not getting installed.Its referring to the old one.

Upvotes: 2

Views: 373

Answers (1)

Rémi Becheras
Rémi Becheras

Reputation: 15232

Use the following syntax for your dependency in you bower.json of your main app:

"My-Component": "~1.0.12"

this mean "at least that version, but not greater than 2.x"

If all is done as it should be, maybe you simply need to clear bower cache:

bower cache clean

then re-install:

bower install

If not, there is something wrong with your component.

Maybe you missed to tag the new version of your component:

cd ~/My-Component/
git tag v1.0.13
git push upstream
git push --tags

Then update your main app:

cd ~/MyApp/
bower install My-Component --save

Upvotes: 2

Related Questions