Search code examples
bowerangular-cookies

How to specify a particular provider of a bower dependency


I want to use angular-cookies from bower but when I do:

bower install angular-cookies it sometimes fetches the one published by the angular team and sometimes some other old incompatible one from an independent author (angularify)

If I do manage to get the official one, then whenever I run bower install ... again, for some other reason, bower will switch the version of angular-cookies that I already have, breaking my application.

How can I do something like:

bower install --force https://github.com/angular/bower-angular-cookies


Solution

  • As the doc specifies - you can add something like:

    "dependencies": {
       "angular-cookies": "git://github.com/angular/bower-angular-cookies"
    }
    

    Which will cause bower to get the dependency from the git repo you want. You can also use git://github.com/angular/bower-angular-cookies#branch_name or git://github.com/angular/bower-angular-cookies#tag_name to specify a specific branch or tag.

    See this question as well.