1

I've installed another additional module for my app with bower. As project dependencies in bower.json were not very strict, and a lot of time passed since last update, bower updated a lot of packages to newer ones. There were a lot of changes, and incompatibility between packages was the reason for major app crash.

I never asked for this, not a good moment for total upgrade&debug. How can I just roll back to previous packages?

  • Original package sources are in .gitignore and built with grunt into one file (so I can't just revert the commit - as packages renewed by bower will be the same in the next build)
  • I couldn't find out the old package set which was OK for my app (as package sources with specific version numbers are in .gitignore) UPD: found versions in built file, see my answer
  • I couldn't find any information about sort of "bower package history" or "bower undo".

UPD: I solved the issue for myself and described the solution in the answer. But I'm really not sure it's a good way, and would be grateful for any kind of mentorship about the subject.

Community
  • 1
  • 1
Konst54
  • 175
  • 9
  • I'd recommend to try and fix the issues that is causing your app to crash. – Wayne Ellery Dec 26 '14 at 01:26
  • @WayneEllery, your point of view is right, and we should do clean and ideal apps. But sometimes you don't have time to debug tons of legacy code - and you just want to return to previous state, planing an _important_ issue for future as a less _urgent_. – Konst54 Dec 26 '14 at 01:41
  • 1
    I'm not that familiar with Bower. Have you tried this to install the older version of Angular http://stackoverflow.com/questions/19030170/what-is-the-bower-version-syntax – Wayne Ellery Dec 26 '14 at 02:12
  • @WayneEllery , thanks for your comments. I reworked the question to make it more clear & specific, could you please upvote it, or point out what else should I do to make it a good question? I am new to stackoverflow, hope I'll learn to post better questions soon :) – Konst54 Jan 17 '15 at 19:28

1 Answers1

1

I solved the problem for myself by digging into incompatiblities showed by bower, and finding compromise package set. Main issues were between newest angular asked by some packages and angular-ui-bootsrap working with older versions only for that moment. Also there were some issues with other newest packages, which I downgraded and will solve later on. So I used bower install [PackageName]#=[SpecificPackageVersion] (can use --save here to save it to bower.json) for manually setting compromise packages.

At the moment I realized, that there were old package versions in license comment blocks in the previous commits of built file, so in order to have old working set of packages I could:

  1. git checkout HEAD~1 to have old file, which was built with previous package set
  2. grep (search) package names or license comments in it
  3. bower install [PackageName]#=[OldWorkingPackageVersion] (can use --save to save it to bower.json)
  4. git checkout [BranchName] to make HEAD back
  5. Make build (with previous packages installed again)

However, I'm not sure it's a good solution, and would be grateful for any kind of clarification about the subject.

Konst54
  • 175
  • 9