Typing $ bower install angular-ui-router, I get the following:
Unable to find a suitable version for angular, please choose one:
1) angular#1.0.7 which resolved to 1.0.7 and has mySteroidsProject as dependants
2) angular#* which resolved to 1.2.13 and has restangular#1.0.7 as dependants
3) angular#>= 1.0.8 which resolved to 1.2.14-build.2338+sha.27873ac and has angular-ui-router#0.2.8 as dependants
Prefix the choice with ! to persist it to bower.json
[?] Answer:
While I am happy that bower takes care of these dependencies for me, I am at aloss of what to do when a conflict occurs. With a newly started project (within the past week), what differentiates these choices?
I am using steroids, which also has phonegap,
Related
First, I am unsure how checking the version of Angular because if I type the command, "Angular -v" it says "Angular: command not found". I think someone told me that it was version 1.5, but I want it to be 1.6 or whatever the latest angular 1 version is available to upgrade.
Lastly, what is the command to update the version to the latest version of Angular 1.x? Is it, "npm install [NAME OF ANGULAR 1.X PACKAGE]"?
You can use the npm update as per the npm documentation:
https://docs.npmjs.com/all
You can run an npm outdated first to see what is in need of updating and then run the npm update, but some combination in the command prompt of...
npm update
npm outdated
... should at least get you started.
As for your version of angular somewhere in your project you have to have the angular source code thaht will include the license version, or a link to a cdn or the like for it. Maybe search the project for something like "license AngularJS v".
The uninstall/reinstall works too, but you might need to do it for more than just the angular package. Even with the update method it is likely that you'll need to look into dependencies and other packages that will become outdated.
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
I have a basic angular project on github based off of Angular Seed. I have travis set up to do testing, and it keeps getting this error:
npm ERR! angular-seed#0.0.0 postinstall: `bower install`
This is the full output:
https://travis-ci.org/RobKohr/islandwarfare.com/builds/44103657
and this is the commit:
https://github.com/RobKohr/islandwarfare.com/commit/0a8b1c373c8a5b5736f8c236633755bff353b164
How can I stop this error from occuring?
The postinstall step of your package is running bower install - this is the failing part of the build (as indicated by the error).
bower install fails since Bower is unable to find a suitable version of angular. This happens different version of angular are required by your package dependencies. In this case this is the conflict as presented by bower:
Unable to find a suitable version for angular, please choose one:
1) angular#1.2.27 which resolved to 1.2.27 and is required by angular-loader#1.2.27, angularmocks#1.2.27, angular-route#1.2.27
2) angular#1.2.x which resolved to 1.2.27 and is required by angular-seed
3) angular#1.3.6 which resolved to 1.3.6 and is required by angular-resource#1.3.6
You can solve this conflict by forcing a specific version of angular in your bower.json. For example to force the resolution of angular 1.2.27 add the following:
"resolutions": {
"angular": "1.2.27"
}
Having got through https://docs.angularjs.org/tutorial I've decided to add there some componenets from http://angular-ui.github.io/bootstrap/ . To do so I ran
bower install angular-bootstrap
as suggested here https://github.com/angular-ui/bootstrap#installation. But I got
bower ECONFLICT Unable to find suitable version for angular
Then I noticed that "angular-bootstrap" on bower (http://bower.io/search/?q=angular-bootstrap) points to some other project (https://github.com/angular-ui/bootstrap-bower) whereas https://github.com/angular-ui/bootstrap has name "angular-ui-bootstrap" there. So I tried
bower install angular-ui-bootstrap --save
and it seemed to work. So, the questions are:
1) Did I add correct angular-ui? Although bower worked, the components I added to my page were screwed.
2) Do I understand correctly that bower decides if version is suitable or not based on data it takes from its http://bower.io/?
Best regards, Eugene.
UPD: seems to be it was wrong angular-ui - https://github.com/angular-ui/bootstrap/issues/1936
My question is very basilar, but I didn't found anything in the web: how can I tell Yeoman to use a specific version of Angularjs instead of the latest available?
Thanks
You can force Angular's requested version in generated bower.json file, and then running bower install...
Then please be sure all other dependencies in bower.json file are not broken by the previous downgrade, possibly downgrading other libraries versions, too...