angular-datepicker icon indicating copy to clipboard operation
angular-datepicker copied to clipboard

Bower install : Angular version problem

Open WilliamChelman opened this issue 10 years ago • 11 comments

Using angular 1.4.7, when I try to install date-picker through bower, I get

bower angular-datepicker#* cached git://github.com/g00fy-/angular-datepicker.git#2.0.0 bower angular-datepicker#* validate 2.0.0 against git://github.com/g00fy-/angular-datepicker.git#* bower angular#1.2.14 cached git://github.com/angular/bower-angular.git#1.2.14 bower angular#1.2.14 validate 1.2.14 against git://github.com/angular/bower-angular.git#1.2.14 bower angular#>=1.3.0 cached git://github.com/angular/bower-angular.git#1.4.7 bower angular#>=1.3.0 validate 1.4.7 against git://github.com/angular/bower-angular.git#>=1.3.0 bower angular#^1.4.7 <2 cached git://github.com/angular/bower-angular.git#1.4.7 bower angular#^1.4.7 <2 validate 1.4.7 against git://github.com/angular/bower-angular.git#^1.4.7 <2 bower angular#1.4.7 cached git://github.com/angular/bower-angular.git#1.4.7 bower angular#1.4.7 validate 1.4.7 against git://github.com/angular/bower-angular.git#1.4.7 bower angular#>=1.2.16 1.4.x cached git://github.com/angular/bower-angular.git#1.4.7 bower angular#>=1.2.16 1.4.x validate 1.4.7 against git://github.com/angular/bower-angular.git#>=1.2.16 1.4.x bower angular#>=1.2.18 cached git://github.com/angular/bower-angular.git#1.4.7 bower angular#>=1.2.18 validate 1.4.7 against git://github.com/angular/bower-angular.git#>=1.2.18 bower ECONFLICT Unable to find suitable version for angular

In the bower.json, the dependencies are

"dependencies": { "angular": "1.2.14", "moment": "~2.10.6", "moment-timezone": "~0.4.1" },

Shouldn't it be "angular": ">=1.2.14" since it is supposed to work with angular 1.2+ ?

WilliamChelman avatar Nov 04 '15 10:11 WilliamChelman

I think the angular version needs to be at least 1.3, as the library is using some features of angular which were added in 1.3

  • $validators are used here and here.
    • I cannot find any official documentation that explicitly states what version of angular the $validators pipeline was added, but many blog posts mention that it is new in 1.3.
    • The docs for 1.2 make no mention of $validators.
    • The docs for 1.3 have information on $validators.
  • $watchGroup is used in this PR in the date-range directive. Again, this is a feature of angularjs 1.3+

If support for angular 1.2 is required, $validators and $watchGroup cannot be used, and must be replaced with something else.

DanTalash avatar Nov 05 '15 17:11 DanTalash

Yes, but I use Angular 1.4.7, so there should not be compatibility issues with date-picker which requires 1.2+ no ? (the bower.json that I mentionned is the one of date-picker, sorry if I was not clear enough)

WilliamChelman avatar Nov 05 '15 23:11 WilliamChelman

I have the same issue. Current bower.json has strict dependency on angular 1.2.14 and this does not work with 1.4.7.

alexeyzimarev avatar Nov 08 '15 18:11 alexeyzimarev

same issue

valera33 avatar Nov 11 '15 20:11 valera33

also the same issue

timmyomahony avatar Nov 12 '15 16:11 timmyomahony

+1

mcranston18 avatar Nov 23 '15 18:11 mcranston18

+1

Steve-Mc avatar Nov 27 '15 12:11 Steve-Mc

+1

dejan7 avatar Dec 01 '15 16:12 dejan7

+1

randyv12 avatar Dec 02 '15 18:12 randyv12

I'm a little mad that this hasnt been fixed since it's so easy to there are probably a dozen pull requests for it.

Here's the simple fix for your environment:

add the following to your bower.json

"resolutions": { "angular": "~1.4.7" <-- or whatever version of angular you are using }

this will force bower to select the version of angular you want instead of being stuck with the 1.2 version the library uses.

AdamHess avatar Mar 08 '16 16:03 AdamHess

+1

larryspace avatar Feb 18 '17 02:02 larryspace