Bower install anuglar-module is installs angular instead? - angularjs

I am trying to install this angular module (angular-stripe). When I type bower install angular-stripe (as the docs recommend) I get:
bower angular-stripe#* cached git://github.com/bendrucker/angular-stripe.git#4.1.0
bower angular-stripe#* validate 4.1.0 against git://github.com/bendrucker/angular-stripe.git#*
bower angular-cookies#~1.3.11 cached git://github.com/angular/bower-angular-cookies.git#1.3.12
bower angular-cookies#~1.3.11 validate 1.3.12 against git://github.com/angular/bower-angular-cookies.git#~1.3.11
bower angular#1.3.12 cached git://github.com/angular/bower-angular.git#1.3.12
bower angular#1.3.12 validate 1.3.12 against git://github.com/angular/bower-angular.git#1.3.12
Unable to find a suitable version for angular, please choose one:
1) angular#1.3.11 which resolved to 1.3.11 and is required by angular-animate#1.3.11, angular-cookies#1.3.11, angular-mocks#1.3.11, angular-resource#1.3.11, angular-route#1.3.11, angular-sanitize#1.3.11, angular-scenario#1.3.11, angular-touch#1.3.11, nightwalker
2) angular#~1.3.2 which resolved to 1.3.11 and is required by angular-stripe#4.1.0
3) angular#1.3.12 which resolved to 1.3.12 and is required by angular-cookies#1.3.12Prefix the choice with ! to persist it to bower.json
This looks like I am installing angular all over again or something. Is there a way to avoid this?

You need to add the resolution
"resolutions": {
"angular": "~1.3.x"
}
In your bower.json file

Related

Why is bower not using my bower.json resolutions?

I have a project I need to use angularjs 1.2 with. I have a bower.json file with the following:
{
"name": "myproject",
"dependencies": {
"angular": "1.2.32"
},
"resolutions": {
"angular": "1.2.32"
}
}
When I install angular it asks me which version I want, although it should not if I understood correctly. And when I try to install another project like angular-route it asks again and even installs the wrong one:
bower install angular-route
bower angular-route#* cached https://github.com/angular/bower-angular-route.git#1.6.4
bower angular-route#* validate 1.6.4 against https://github.com/angular/bower-angular-route.git#*
bower angular#1.6.4 cached https://github.com/angular/bower-angular.git#1.6.4
bower angular#1.6.4 validate 1.6.4 against https://github.com/angular/bower-angular.git#1.6.4
Unable to find a suitable version for angular, please choose one by typing one of the numbers below:
1) angular#1.2.32 which resolved to 1.2.32 and is required by angamcharts2
2) angular#1.6.4 which resolved to 1.6.4 and is required by angular-route#1.6.4
Prefix the choice with ! to persist it to bower.json
? Answer !1
bower angular resolution Saved angular#1.2.32 as resolution
bower angular-route#^1.6.4 install angular-route#1.6.4
angular-route#1.6.4 bower_components/angular-route
└── angular#1.2.32
I know there is angular-route 1.2.32 but I don't want to install all my packages by hand with the correct version. Why is the "resolutions" not working?

Implement Angular Materials on Angular Seed Template fails

still learning angular and started to use the seed angular application skeleton.
There I got Problems to implement the angular-material library and CSS by npm/bower.
Thats my Problem:
$ bower install angular-material
bower angular-material#* cached https://github.com/angular/bower-material.git#1.1.4
bower angular-material#* validate 1.1.4 against https://github.com/angular/bower-material.git#*
bower angular-animate#^1.4.8 cached https://github.com/angular/bower-angular-animate.git#1.6.4
bower angular-animate#^1.4.8 validate 1.6.4 against https://github.com/angular/bower-angular-animate.git#^1.4.8
bower angular-aria#^1.4.8 cached https://github.com/angular/bower-angular-aria.git#1.6.4
bower angular-aria#^1.4.8 validate 1.6.4 against https://github.com/angular/bower-angular-aria.git#^1.4.8
bower angular-messages#^1.4.8 cached https://github.com/angular/bower-angular-messages.git#1.6.4
bower angular-messages#^1.4.8 validate 1.6.4 against https://github.com/angular/bower-angular-messages.git#^1.4.8
bower angular#1.6.4 cached https://github.com/angular/bower-angular.git#1.6.4
bower angular#1.6.4 validate 1.6.4 against https://github.com/angular/bower-angular.git#1.6.4
bower angular#1.5.11 cached https://github.com/angular/bower-angular.git#1.5.11
bower angular#1.5.11 validate 1.5.11 against https://github.com/angular/bower-angular.git#1.5.11
bower ECONFLICT Unable to find suitable version for angular
How can I solve this´?

Add Angular-ui through bower

I'd like to use the angular-ui filters package and I'd like to install it through bower. I've run bower install --save angular-ui which installs it and inserts it into the bower.json file.
Unfortunately it doesn't seem to actually import the files into the project. I've already got ui.bootstrap in there, I can't find any instructions to install the filters part.
I've seen issues where the folder already exists in bower_components and so bower assumes that its already there and doesn't add the files.
bower uninstall angular-ui
check that the angular-ui folder isn't in bower-components and if it is then delete it.
bower install angular-ui --save

Angular Mocks install ask me for dependencies

Sincerely I don't know what to answer ... I'm newbie in Ionic + Angular ... I'm trying to install Angular Mocks but it says about Angular version.
$ sudo bower install angular-mocks --allow-root
bower angular-mocks#* cached git://github.com/angular/bower-angular-mocks.git#1.4.1
bower angular-mocks#* validate 1.4.1 against git://github.com/angular/bower-angular-mocks.git#*
bower angular#1.4.1 cached git://github.com/angular/bower-angular.git#1.4.1
bower angular#1.4.1 validate 1.4.1 against git://github.com/angular/bower-angular.git#1.4.1
bower angular#^1 cached git://github.com/angular/bower-angular.git#1.4.1
bower angular#^1 validate 1.4.1 against git://github.com/angular/bower-angular.git#^1
bower angular#>= 1.0.8 cached git://github.com/angular/bower-angular.git#1.4.1
bower angular#>= 1.0.8 validate 1.4.1 against git://github.com/angular/bower-angular.git#>= 1.0.8
bower angular#>= 1.2.23 cached git://github.com/angular/bower-angular.git#1.4.1
bower angular#>= 1.2.23 validate 1.4.1 against git://github.com/angular/bower-angular.git#>= 1.2.23
bower angular#1.3.16 cached git://github.com/angular/bower-angular.git#1.3.16
bower angular#1.3.16 validate 1.3.16 against git://github.com/angular/bower-angular.git#1.3.16
bower angular#1.3.13 cached git://github.com/angular/bower-angular.git#1.3.13
bower angular#1.3.13 validate 1.3.13 against git://github.com/angular/bower-angular.git#1.3.13
Unable to find a suitable version for angular, please choose one:
1) angular#1.3.13 which resolved to 1.3.13 and is required by ionic#1.0.0
2) angular#1.3.16 which resolved to 1.3.16 and is required by angular-resource#1.3.16
3) angular#>=1.0.0 <1.5.0 which resolved to 1.4.0 and is required by angular-moment#0.9.2
4) angular#1.4.1 which resolved to 1.4.1 and is required by angular-mocks#1.4.1
5) angular#^1 which resolved to 1.4.1 and is required by angular-slugify#1.2.0
6) angular#>= 1.0.8 which resolved to 1.4.1 and is required by angular-ui-router#0.2.13
7) angular#>= 1.2.23 which resolved to 1.4.1 and is required by ngCordova#0.1.17-alpha
Prefix the choice with ! to persist it to bower.json
? Answer:
angular-mock requires angular, but angular is not in your project. It's bundled up with the ionic library. This means you need version 1.3.13 -> Choose #1
please add this code in bower.json
"resolutions": {
"angular": "1.2.0-rc.2"
}

Bower install unstable release (1.4.0-rc.0) of angular

Having trouble installing angular#1.4.0-rc.0 via bower - when I run:
bower install --save angular#1.4.0-rc.0
I get the error
no matches found: angular#1.4.0-rc.0
However running bower update angular shows packages that depend on 1.4.0-rc.0:
angular-cookies#1.4.0-rc.0 depends on angular#1.4.0-rc.0 which resolved to angular#1.4.0-rc.0
Adding "angular": "~1.4.0-rc.0" or "angular": "1.4.0-rc.0" doesn't help either!
Thanks guys!
delete your previous bower_components folder or your custom location.
Thanks to #nitin, deleting my bower_components folder and reinstalling did the trick.

Resources