0

I am using bower.json to manage my front end dependencies.. no matter however i specify the version of angular in bower i end up getting different version of angular library... Many of the functionality of my code are from previous version of angulars so the functions like $http.post.success() are depracted here and the code does not work. I need angular v 1.4.8 but it always downloads some other v1.5.9.build version. Here is how i tried downloading the package from bower.json

1) Mentioning the versions only..

"dependencies": {
"angular": "1.4.8",
"jquery": "2.1.4"
 },
"resolutions": {
"jquery": "2.1.4",
"angular": "1.4.8"

2) I tried this way as well giving the full path of the repo in github

"dependencies": {
"angular": "https://github.com/angular/bower-angular.git#1.4.8",
"jquery": "2.1.4"
 },
"resolutions": {
"jquery": "2.1.4",
"angular": "https://github.com/angular/bower-angular.git#1.4.8"

Any help would be greatly appreciated

user1505521
  • 231
  • 1
  • 2
  • 12
  • `bower install angular@1.4.8`? no idea if that works with bower, but with npm it would. – Stephan Bijzitter Oct 31 '16 at 19:37
  • I suspect you have encountered this issue https://github.com/aspnet/Tooling/issues/665 – Joe Audette Oct 31 '16 at 19:41
  • @JoeAudette: There are bunch of solutions from different people let me try some... and will let you know.. – user1505521 Oct 31 '16 at 19:51
  • We had the same issue but with bit older angular version.. figured out over cmd it wont show bunch of warnings where bower asks for resolutions..Used webstrom terminal and then persisted the required version number...Also worth mentioning is sometimes its better to delete bower_components folder and run bower install. – Anirudh Mangalvedhekar Oct 31 '16 at 19:51
  • @JoeAudette: Thanks buddy you are a true life saver.. apparently one of the solutions worked... – user1505521 Oct 31 '16 at 19:56

1 Answers1

0

So in my case apparently the problem was git from Visualt Studio Web Tools located at

C:\Program Files (x86)\Microsoft Visual Studio 14.0\Web\External\git

With it, bower tries to install correct versions, but if you look into the bower cache you can see that actual downloaded files don't match.

Solutions

  • Install Git for Windows
  • Delete %USERPROFILE%\AppData\Local\bower
  • Restart Visual Studio
  • Delete wwwroot/lib and Restore bower packages

You might need to change the point the path of current git.exe in VS

for that:

Tools>Options>ProjectsandSolutions>ExternalTools

See the original answer here https://stackoverflow.com/a/38460014/1505521

Community
  • 1
  • 1
user1505521
  • 231
  • 1
  • 2
  • 12