Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bower: force update of local package

Tags:

I need to force bower to override a locally-defined dependency with a fresh copy. I assumed that bower update <package> would do the trick (even with a little extra --force). However, it stubbornly prefers whatever copy is installed under bower_components.

Consider the following layout (all in one codebase for now, sadly):

shared/bower.json

{   "name": "mysharedstuff",   "version": "0.0.1",   ... } 

client1/bower.json

{   ...   "dependencies": {     "mysharedstuff": "../shared"   } } 

The only way I can get a fresh copy of shared/ is to explicitly delete the copy installed under bower_components. For example:

client1$> rm -rf bower_components/mysharedstuff client1$> bower install 

Is this a bug with how bower handles versioning of local dependencies? Or am I missing something simple?

like image 596
Courtney Christensen Avatar asked Nov 26 '13 19:11

Courtney Christensen


People also ask

How do I update my bower package?

If there aren't that many bower packages you have installed, try writing bower install [package_name] --save . This will just update your bower. json file.

Is bower still supported?

Bower has been deprecated by its creators The open source project continues to be maintained for the benefit of existing users, but this is a prime reason not to continue using the platform.

How do you get the latest version of the dependencies as per the json file installed?

For updating a new and major version of the packages, you must install the npm-check-updates package globally. It will display the new dependencies in the current directory whereas running this command will list all the global packages which have new releases.


1 Answers

Just to update from the github issue you referenced.

bower --force update 

will force update any packages in your bower.json. Works in Bower > v1.3.6

like image 149
Ryan H Lewis Avatar answered Jan 29 '23 08:01

Ryan H Lewis