Why does Bower remove my "resolutions" and how do I stop it -
i have bower.json file
{ "name": "example-project", "private": true, "dependencies": { "angular": "1.2.14", "angular-scenario": "1.2.14", "angular-resource": "1.2.14", "angular-ui-router": "0.2.10", "angular-strap": "2.0.0" } }
when run grunt
(with grunt-bowercopy or grunt-bower-task) error fatal error: unable find suitable version angular
when run bower install
says doesn't know version of angular use:
unable find suitable version angular, please choose one: 1) angular#1.2.14 resolved 1.2.14 , required angular-scenario#1.2.14, example-project 2) angular#>= 1.0.8 resolved 1.2.16 , required angular-ui-router#0.2.10 3) angular#~1.2.10 resolved 1.2.16 , required angular-strap#2.0.0 prefix choice ! persist bower.json
so explains why grunt failing - had transitive dependencies , didn't know 1 select. choose 1 (!1
persist). bower.json looks this:
{ "name": "example-project", "private": true, "dependencies": { "angular": "1.2.14", "angular-scenario": "1.2.14", "angular-resource": "1.2.14", "angular-ui-router": "0.2.10", "angular-strap": "2.0.0" }, "resolutions": { "angular": "1.2.14" } }
sweet! run bower install
again. time succeeds removes "resolutions" part. works me without resolutions, coworkers same error , have go through same process.
why this? there way stop happening?
-update-
it seems bug. see bower issues https://github.com/bower/bower/issues/1061 , https://github.com/bower/bower/issues/1272. issue attention , resolved.
upgrade bower 1.4.0 or greater issue resolved.
previous answer: workaround suggested edeustace (see https://github.com/bower/bower/issues/1061) add script build (grunt, gulp, etc) resets resolutions should after running bower. it's ugly solution should trick until issue gets resolved.
Comments
Post a Comment