Bower: ECONFLICT Unable to find suitable version for angular

Created on 11 Sep 2013  路  30Comments  路  Source: bower/bower

Hi,
I have strange problem with bower.
On my PC I run bower install and on my server with same version of bower 1.2.6 I'm getting

bower angular#*                         validate 1.0.8 against git://github.com/angular/bower-angular.git#*
bower                                  ECONFLICT Unable to find suitable version for angular

I don't know what could cause this
This is how my bower.json looks like.

{
  "name": "project",
  "version": "0.0.1",
  "devDependencies": {
    "angular": "~1.2.0-rc.2",
    "angular-mocks": "~1.2.0-rc.2",
    "bootstrap": "~2.3.2",
    "angular-bootstrap": "~0.5.0",
    "angular-ui-router": "~0.0.1",
    "angular-ui-utils": "~0.0.4",
    "angular-sanitize": "~1.2.0-rc.2",
    "angular-resource": "~1.2.0-rc.2",
    "angularytics":"0.2.2",
      "json2":"*",
    "underscore":"1.5.1",
    "restangular":"1.1.3",
    "tinymce": "git://github.com/jozzhart/tinymce.git#4.0.0"
  },
  "dependencies": {}
}

Most helpful comment

Use --force-latest or add component version to resoltions key in bower.json

All 30 comments

I get exactly the same thing. On my local machine it offered me a menu to choose the option to resolve against 鈥撀爀ven though one of the options had _exactly the same_ version string as the one I'd asked it to install. The problem is on our continuous integration server there's no way to make that selection so committing the updated bower.json to source control breaks our build.

Those questions only appear when running in an interactive shell. Be sure to persist your choices to the bower.json by prefixing the choice with !.

Subsequent installs will obey the choice you made previously.

Please let me know if persisting the resolutions solved the problem so I can close this out.

I don't know how to get the resolution to persist now I've already chosen an option. I deleted all the Bower dependencies and ~/.bower but I'm not being asked again.

It's also not clear why there's a conflict in the first place. I haven't asked for an ambiguous version of Angular and all the dependencies in my _bower.json_ file depend on the exact same version so why is the conflict there?

Same problem there. Breaking our build on integration server, and no way to force the version. Everything working on local machine... any way around ?

I can't replicate. I've tried the json file above on an non-interactive shell and works. Can you guys give me a way to replicate?

My conflicting json was the following :

"dependencies": {
    "underscore":"*",
    "momentjs":"~2.2.1",
    "bootstrap": "~3.0.0",
    "jquery": "~1.9.1",
    "jquery.cookie": "*",
    "jquery-ui": "~1.10.3",
    "jquery-file-upload": "*",
    "angular": "=1.2.0-rc.2",
    "angular-route": "=1.2.0-rc.2",
    "angular-resource": "=1.2.0-rc.2",
    "angular-animate": "=1.2.0-rc.2",
    "angular-cookies": "=1.2.0-rc.2",
    "angular-i18n": "=1.2.0-rc.2",
    "angular-bootstrap" : "*",
    "ng-grid": "*",
    "highcharts": "*",
    "highcharts-ng": "*"
},

"devDependencies": {
    "angular-mocks": "=1.2.0-rc.2",
    "angular-scenario": "=1.2.0-rc.2"
}

and the result in an interactive shell :

Unable to find a suitable version for angular, please choose one:
1) angular#1.0.8 which resolved to 1.0.8 and has angular-scenario#1.2.0-rc.2 as dependants
2) angular#1.2.0-rc.2 which resolved to 1.2.0-rc.2 and has angular-animate#1.2.0-rc.2, angular-cookies#1.2.0-rc.2, angular-mocks#1.2.0-rc.2, angular-resource#1.2.0-rc.2, angular-route#1.2.0-rc.2, angular-scenario#1.2.0-rc.2 as dependants
3) angular#~1.2.0-rc.2 which resolved to 1.2.0-rc.2 and has tael-web as dependants
4) angular#>=1 which resolved to 1.2.0-rc.2 and has angular-bootstrap#0.6.0 as dependants
5) angular#>=1.0.4 which resolved to 1.2.0-rc.2 and has highcharts-ng#0.0.2 as dependants 

But this is very strange because bower seems to think angular-scenario 1.2.0-rc.2 depends on angular 1.0.8.. which is totally false ( just check to repository )...

Is there any caching of any kind when resolving / updating dependencies ?

@wayofspark no conflict was produced when installing the dependencies you listed:

bower angular-route#=1.2.0-rc.2          install angular-route#1.2.0-rc.2
bower angular-animate#=1.2.0-rc.2        install angular-animate#1.2.0-rc.2
bower angular-resource#=1.2.0-rc.2       install angular-resource#1.2.0-rc.2
bower angular-cookies#=1.2.0-rc.2        install angular-cookies#1.2.0-rc.2
bower jquery.cookie#*                    install jquery.cookie#1.3.1
bower jquery-file-upload#*               install jquery-file-upload#8.8.5
bower jquery#~1.9.1                      install jquery#1.9.1
bower angular-bootstrap#*                install angular-bootstrap#0.6.0
bower angular-i18n#=1.2.0-rc.2           install angular-i18n#1.2.0-rc.2
bower highcharts-ng#*                    install highcharts-ng#0.0.2
bower angular-mocks#=1.2.0-rc.2          install angular-mocks#1.2.0-rc.2
bower angular#=1.2.0-rc.2                install angular#1.2.0-rc.2
bower highcharts#*                       install highcharts#3.0.5
bower angular-scenario#=1.2.0-rc.2       install angular-scenario#1.2.0-rc.2
bower momentjs#~2.2.1                    install momentjs#2.2.1
bower underscore#*                       install underscore#1.5.2
bower ng-grid#*                          install ng-grid#2.0.7
bower blueimp-canvas-to-blob#>=2.0.7     install blueimp-canvas-to-blob#2.0.7
bower jquery-ui#~1.10.3                  install jquery-ui#1.10.3
bower blueimp-load-image#>=1.9.1         install blueimp-load-image#1.9.1
bower blueimp-tmpl#>=2.3.0               install blueimp-tmpl#2.4.0
bower bootstrap#~3.0.0                   install bootstrap#3.0.0

What version of bower are you guys using?

I can confirm this bug. Both running bower install angular#1.2.0-rc.2 from console and having "angular": "1.2.0-rc.2", in dependencies and running bower install shows the question:

Unable to find a suitable version for angular, please choose one:
1) angular#~1.0 || ~1.1 which resolved to 1.0.8 and has angular-webstorage#0.9.3 as dependants
2) angular#=1.2.0-rc.2 which resolved to 1.2.0-rc.2 and has angular-client as dependants
3) angular#1.2.0-rc.2 which resolved to 1.2.0-rc.2 and has angular-mocks#1.2.0-rc.2 as dependants
4) angular#>=1 which resolved to 1.2.0-rc.2 and has angular-bootstrap#0.6.0 as dependants
5) angular#>= 1.0.6 which resolved to 1.2.0-rc.2 and has angular-ui-router#0.2.0 as dependants
6) angular#>= 1.0.2 which resolved to 1.2.0-rc.2 and has angular-ui-utils#0.0.4 as dependants

Working bower.json file:

{
  "name": "app",
  "version": "0.1.0",
  "dependencies": {
    "angular": "1.2.0-rc.2",
    "angular-animate": "~1.2.0-rc.2",
    "angular-bootstrap": "~0.6.0",
    "angular-resource": "1.2.0-rc.2",
    "angular-route": "1.2.0-rc.2",
    "angular-sanitize": "1.2.0-rc.2",
    "angular-translate": "~1.1.0",
    "es5-shim": ">=2.1.0",
    "html5shiv": ">=3.7.0",
    "json3": ">=3.2.5",
    "normalize-css": ">=2.1.3",
    "respond": "~1.3.0",
    "angular-loading-bar": "~0.0.4"
  },
  "devDependencies": {
    "angular-mocks": "1.2.0-rc.2",
    "angular-scenario": "1.2.0-rc.2"
  },
  "resolutions": {
    "angular": "1.2.0-rc.2"
  }
}

I tried to upgrade to Angular 1.0.2-rc.3 this morning and got the same problem again. I manually modified the version numbers in my _bower.json_ file and it now contains this:

{
  "name": "myApp",
  "version": "0.0.0",
  "dependencies": {
    "jquery": "1.10.2",
    "json3": "~3.2.4",
    "es5-shim": "~2.0.8",
    "jsonlint": "https://github.com/zaach/jsonlint",
    "bootstrap": "~3.0.0",
    "momentjs": "~2.2.1",
    "angular": "~1.2.0-rc.3",
    "angular-route": "~1.2.0-rc.3",
    "angular-resource": "~1.2.0-rc.3",
    "angular-cookies": "~1.2.0-rc.3",
    "angular-sanitize": "~1.2.0-rc.3",
    "jquery.jqplot.1.0.8r1250.tar.gz": "https://bitbucket.org/cleonello/jqplot/downloads/jquery.jqplot.1.0.8r1250.tar.gz",
    "jquery-smartresize": "https://github.com/louisremi/jquery-smartresize.git"
  },
  "devDependencies": {
    "angular-mocks": "~1.2.0-rc.3",
    "angular-scenario": "~1.2.0-rc.3"
  }
}

I then ran bower install and got the following output:

Unable to find a suitable version for angular, please choose one:
    1) angular#1.2.0-rc.2 which resolved to 1.2.0-rc.2 and has angular-cookies#1.2.0-rc.3, angular-scenario#1.2.0-rc.3 as dependants
    2) angular#1.2.0-rc.3 which resolved to 1.2.0-rc.3 and has angular-mocks#1.2.0-rc.3, angular-resource#1.2.0-rc.3, angular-route#1.2.0-rc.3, angular-sanitize#1.2.0-rc.3, angular-scenario#1.2.0-rc.3 as dependants
    3) angular#~1.2.0-rc.3 which resolved to 1.2.0-rc.3 and has myApp as dependants

@robfletcher You have a genuine version conflict here. The angular-cookies tag for rc.3 has an out of date bower.json that has a version of rc.2 and depends on exactly rc.2 of angular. All of the others have an exact dependency on rc.3.

Since the version cannot be exactly rc.2 and exactly rc.3 there is a conflict. angular-cookies needs to have an up to date bower.json.

@wibblymat ah, thanks. I selected option 2 and it added this to _bower.json_:

"resolutions": {
  "angular": "1.2.0-rc.3"
}

All seems good now.

Is there a way to avoid this prompt completely?

Use --force-latest or add component version to resoltions key in bower.json

Okay, thanks.

@satazor thanks for the tip about prefix choices with !. That solved my issue.

+1

Adding angular entry to "resolutions" in angular worked for me.
@robfletcher Thanks for sharing solution!

It worked for me by making following changes in "bower.json":

"angular": "latest",
"angular-mocks": "latest",
"jquery": "latest",
"bootstrap": "latest"

there was a mismatch in the version updated and the version that I got from Git for "angular-phonecat"

add --force like this

bower install angular-route --force

Thank you for your answer at @ykanzi

I had the same issue with a different setup:
We have an Artifactory proxy that is accessing the public bower repository. So the chain goes like this: bower install -> bower-art-resolver -> artifactory -> bower public repo

The problem was the bower-art-resolver, after updating to the latest version the conflict was resolved.

@ykanzi 3Q

I solved this error message by using the same version for angular and angular-route

"dependencies": {
"bootstrap": "~3.3.5",
"font-awesome": "~4.4.0",
"angular": "~1.4.7",
"angular-route": "~1.4.7"
}

i have some problem and i resolve it by adding :
"resolutions": {
"angular": "~1.2.0"
}

in bower.json file
with ~1.2.0 is my version of angular , so you need to replace this by your angular version

Hi,
I'm having problems with bower. Can't seem to find a solution.

1. Here is the error message:

$ bower install angular-route -S
bower invalid-meta The "name" is recommended to be lowercase, can contain digits, dots, dashes
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
bower ECONFLICT Unable to find suitable version for angular

2. Injected "resolutions" into my project bower.json file
"dependencies": {
"bootstrap": "~3.3.5",
"font-awesome": "~4.4.0",
"angular": "~1.4.7"
},

"resolutions": {
"angular": "~1.4.7"
}

3. Still getting the same error:
bower ECONFLICT Unable to find suitable version for angular

How can I resolve this problem?

Thanks

don't use command tool of git, use cmd tool of PC.

git error = bower ECONFLICT Unable to find suitable version for xxx

I had an issue like this due to running MinTTY on Windows 10 (Git Bash). This article explains why, and gives two different solutions: https://willi.am/blog/2016/08/08/docker-for-windows-interactive-sessions-in-mintty-git-bash/

Was this page helpful?
0 / 5 - 0 ratings