It is sometimes useful to rebuild the entire site and force bower to reinstall new versions of all packages in bower.json.
However, there seems to be no way to do this:
Attempt # 1:
$ bower uninstall bower not-installed 0
No, this only works on a one-by-one basis, although a clean bower install uses bower.json.
Attempt # 2:
$ bower install -f -l 0 $
No, despite the '-f', it does nothing if the dependencies are met.
Attempt # 3:
$ rm -r bower_components $
! Ah, victory! ... wait, what is it?
rm: bower_components: No such file or directory
Oh my gosh, there is .bowrc in this project that sets up a directory for installing things.
My real horrible solution:
Run a custom script that:
- Parse .bowerrc if one exists - Load the directory if one is specified in the json block - If the directory currently exists... - ...recursively delete the directory.
It works, I suppose, but it's pretty annoying, you need to configure it several times.
Did I miss something?
Is there a simple bower command to remove locally installed modules?
It seems like the really basic functionality that I would have expected to uninstall bower.
(Actually this is not a very javascript question, but I will gladly agree with something that hooks into the bower module somehow so that this happens in a simple node script)
Context
Edit: if you want “motivation” for such a task, then this is: we have a jenkins server that builds our projects and runs tests. However, periodically this happens for no apparent reason; this is almost always because jenkins uses the previous copy of the repository with just git-pull to upgrade to the latest version before creating and running the tests; as a result, the previous bower_components directory exists, and it is filled with cached copies of various components.
Here are some examples of things that are # @ $ @ # $ 'd and require bower to start up again as a push install:
1) Some idiot (> _> fitvids) deletes the previous marked version of the project.
2) Some of the projects left the conversation / moved the github page
3) Some projects (> _> jquery) have changed the way files are placed in a version that is not related to the main version.
I understand that the “right” solution to this problem is: fix jenkins, so it creates a new temporary directory for each assembly .... but this is not under my control.
So, as a build step, I need to automate the way to remove panel components and force them to reinstall; either as a grunting task (part of the assembly), or during the jenkins build process. However, remember from (3) above that our projects use .bowerrc, therefore it is not as simple as simply deleting the folder.
It would be great if I could remove all existing components of the bowler as a preliminary step to do this job.
So ... back to the question: can this be done with a gazebo?