Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ECONFLICT Unable to find suitable version for angular #208

Closed
mbtakanov opened this issue May 11, 2016 · 8 comments
Closed

ECONFLICT Unable to find suitable version for angular #208

mbtakanov opened this issue May 11, 2016 · 8 comments

Comments

@mbtakanov
Copy link

mbtakanov commented May 11, 2016

When I write in GIT Bash:
$ bower install angularjs-toaster --save

The following appear:

bower requirejs#2.2.0           cached https://github.com/jrburke/requirejs-bower.git#2.2.0
bower requirejs#2.2.0         validate 2.2.0 against https://github.com/jrburke/requirejs-bower.git#2.2.0
bower jquery#1.9.1 - 2          cached https://github.com/jquery/jquery-dist.git#2.2.3
bower jquery#1.9.1 - 2        validate 2.2.3 against https://github.com/jquery/jquery-dist.git#1.9.1 - 2
bower angularjs-toaster#*       cached https://github.com/jirikavi/AngularJS-Toaster.git#2.0.0
bower angularjs-toaster#*     validate 2.0.0 against https://github.com/jirikavi/AngularJS-Toaster.git#*
bower angular-animate#>1.2.8    cached https://github.com/angular/bower-angular-animate.git#1.5.5
bower angular-animate#>1.2.8  validate 1.5.5 against https://github.com/angular/bower-angular-animate.git#>1.2.8
bower angular#1.5.5             cached https://github.com/angular/bower-angular.git#1.5.5
bower angular#1.5.5           validate 1.5.5 against https://github.com/angular/bower-angular.git#1.5.5
bower angular#^1.0.8            cached https://github.com/angular/bower-angular.git#1.5.5
bower angular#^1.0.8          validate 1.5.5 against https://github.com/angular/bower-angular.git#^1.0.8
bower                        ECONFLICT Unable to find suitable version for angular

As you can see the last row, I get an error.
And this is my bower.json:

{
  "name": "demo",
  "description": "demo",
  "version": "1.0.0",
  "private": true,
  "dependencies": {
    "angular": "1.5.3",
    "angular-ui-router": "ui-router#0.2.18",
    "gulp": "3.9.1",
    "bootstrap": "3.3.6",
    "components-font-awesome": "4.6.1",
    "requirejs": "2.2.0"
  }
}

Can anyone tell me what is the problem?

@Stabzs
Copy link
Collaborator

Stabzs commented May 11, 2016

It looks like you have a cached version of Angular: 1.0.8. What happens if you uninstall it and clean your npm cache?

It's possible that this thread is related to your issue: bower/bower#866

@mbtakanov
Copy link
Author

mbtakanov commented May 12, 2016

I tried the following:

  1. $ bower cache clean -> same error when tried to install Toaster
  2. $ bower cache clean angular#^1.0.8 -> same error when tried to install Toaster
  3. $ bower cache list -> the result was:
angular=https://github.com/angular/bower-angular.git#1.5.3
angular=https://github.com/angular/bower-angular.git#1.5.5
angular-animate=https://github.com/angular/bower-angular-animate.git#1.5.5
angular-ui-router=https://github.com/angular-ui/ui-router.git#0.2.18
AngularJS-Toaster=https://github.com/jirikavi/AngularJS-Toaster.git#2.0.0
bootstrap=https://github.com/twbs/bootstrap.git#3.3.6
components-font-awesome=https://github.com/components/font-awesome.git#4.6.1
gulp=https://github.com/gulpjs/gulp.git#3.9.1
jquery=https://github.com/jquery/jquery-dist.git#2.2.3
requirejs=https://github.com/jrburke/requirejs-bower.git#2.2.0

And then I tried to install Toaster, but still conflict.
4) Deleted the folder C:\User\MyUser\AppData\Local\bower\cache\packages, but still same error.
5) Re-installed bower, same error appears.
6) Added the following in bower.json:

"resolutions": {
    "angular": "~1.5.x"
  }

It doesn't work as well.

  1. Added manually "toaster": "2.0.0" in bower.json and re-install all bower components and it worked. So I can't really say why --save didn't worked. Any ideas (just of curiosity)?

@Stabzs
Copy link
Collaborator

Stabzs commented May 12, 2016

When I used your bower.json file configuration and ran bower install angularjs-toaster --save, I received the following prompts:

Unable to find a suitable version for angular, please choose one:
    1) angular#1.5.3 which resolved to 1.5.3 and is required by demo
    2) angular#^1.0.8 which resolved to 1.5.3 and is required by angular-ui-router#0.2.18
    3) angular#>1.2.6 which resolved to 1.5.3 and is required by AngularJS-Toaster#2.0.0
    4) angular#1.5.5 which resolved to 1.5.5 and is required by angular-animate#1.5.5

Prefix the choice with ! to persist it to bower.json

It looks like the issue here is actually angular-animate#1.5.5. angular-animate is a dependency of AngularJS-Toaster if/when you need animations. However, because you have not specified a version in your bower.json file, it attempts to use the latest release, 1.5.5, instead of 1.5.3 which is specified by the other angular libraries you are using and in turn tries to depend on angular: 1.5.5. You can quickly and easily fix this by adding angular-animate to your bower.json file with a hard version number.

{
  "name": "demo",
  "description": "demo",
  "version": "1.0.0",
  "private": true,
  "dependencies": {
    "angular": "1.5.3",
    "angular-animate": "1.5.3",
    "angular-ui-router": "ui-router#0.2.18",
    "gulp": "3.9.1",
    "bootstrap": "3.3.6",
    "components-font-awesome": "4.6.1",
    "requirejs": "2.2.0"
  }
}

@mbtakanov
Copy link
Author

That was it. Issue solved.

@Stabzs
Copy link
Collaborator

Stabzs commented May 12, 2016

Glad that helped!

@Stabzs Stabzs closed this as completed May 12, 2016
@usmansaleh
Copy link

usmansaleh commented Mar 30, 2017

@Stabzs i have same problem

{
  "name": "projectName",
  "version": "0.0.1-0",
  "description": "ProjectName",
  "authors": [],
  "license": "MIT",
  "ignore": [
    "**/.*",
    "node_modules",
    "bower_components",
    "test",
    "tests"
  ],
  "devDependencies": {
    "angular-mocks": "^1.5.3",
    "sinon": "http://sinonjs.org/releases/sinon-1.12.1.js",
    "bardjs": "^0.1.8"
  },
  "dependencies": {
    "jquery": "^2.2.2",
    "angular": "1.5.8",
    "angular-sanitize": "~1.5.3",
    "extras.angular.plus": "^0.9.2",
    "font-awesome": "fontawesome#^4.6.3",
    "moment": "^2.17.0",
    "angular-ui-router": "^0.2.18",
    "toastr": "^2.1.2",
    "angular-bootstrap": "^1.2.5",
    "angular-material-data-table": "^0.10.9",
    "ng-csv": "^0.3.6",
    "angular-cookies": "^1.5.8",
    "angular-resource": "^1.5.8",
    "angular-ladda": "^0.4.2",
    "semantic-ui-button": "^2.2.2",
    "mdPickers": "^0.7.5",
    "semantic-ui-icon": "^2.2.3",
    "ng-currency": "^1.1.2",
    "google-maps": "^3.2.1",
    "angular-auto-validate": "^1.19.6",
    "angular-credit-cards": "^3.1.4",
    "lodash": "^4.15.0",
    "jspdf": "^1.2.61",
    "semantic-ui-table": "^2.2.3",
    "angular-raven": "^0.6.2",
    "angular-hmac-sha512": "*",
    "angular-post-message": "^1.4.0",
    "angular-ui-calendar": "~1.0.2",
    "angular-moment": "~0.10.3",
    "angular-filter": "~0.5.11",
    "angular-confirm-modal": "^1.2.6",
    "ui.bootstrap": "^2.1.4",
    "angular-capitalize-filter": "^3.0.0",
    "angular-material": "^1.1.1",
    "angular-animate": "1.5.8",
    "angular-aria": "1.5.8",
    "angular-messages": "^1.5.8",
    "json-export-excel": "ng-json-export-excel#^1.0.2",
    "bootstrap": "^3.3.7",
    "angular-moment-picker": "moment-picker#^0.6.7",
    "angular-google-analytics": "^1.1.8",
    "sweetalert": "^1.1.3",
    "pusher-js": "pusher#^4.0.0",
    "ngmap": "^1.18.4"
  },
  "resolutions": {
    "angular": "~1.5.3",
    "moment": "^2.12.0"
  },
  "overrides": {
    "bootstrap": {
      "main": [
        "dist/css/bootstrap.css",
        "dist/js/bootstrap.js"
      ]
    }
  }
}

but in console i am getting errors in aria.js, message.js.

@Stabzs
Copy link
Collaborator

Stabzs commented Mar 30, 2017

@usmansaleh this doesn't sound like an AngularJS-toaster issue. That said I would recommend you try the same troubleshooting steps I outlined above.

@rohit-totala-enquero
Copy link

For Windows user, running using git bash in Windows, was causing this issue. Running bower cache clean and bower install on PowerShell resolved the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants