Search code examples
javascriptangularjsbowerbower-install

bower ECONFLICT Unable to find suitable version for jquery error even after adding resolutions


"dependencies": { 
  "jquery": "~2.1.4", 
  "angular": "~1.5.0",
  ....
  ....
},
"resolutions": {
  "jquery": "~2.1.4",
  "angular": "~1.5.0"
}

bower install angular-peity --save

bower angular-peity#* cached https://github.com/projectweekend/angular-peity.git#0.0.5 bower angular-peity#* validate 0.0.5 against https://github.com/projectweekend/angular-peity.git#* bower peity#* cached https://github.com/benpickles/peity.git#3.2.1 bower peity#* validate 3.2.1 against https://github.com/benpickles/peity.git#* bower jquery#~2.0.3 cached https://github.com/jquery/jquery-dist.git#2.0.3 bower jquery#~2.0.3 validate 2.0.3 against https://github.com/jquery/jquery-dist.git#~2.0.3 bower jquery#>=1.6 cached https://github.com/jquery/jquery-dist.git#3.1.1 bower jquery#>=1.6 validate 3.1.1 against https://github.com/jquery/jquery-dist.git#>=1.6 bower jquery#>=1.7 cached https://github.com/jquery/jquery-dist.git#3.1.1 bower jquery#>=1.7 validate 3.1.1 against https://github.com/jquery/jquery-dist.git#>=1.7 bower jquery#1.9.1 - 3 cached https://github.com/jquery/jquery-dist.git#3.1.1 bower jquery#1.9.1 - 3 validate 3.1.1 against https://github.com/jquery/jquery-dist.git#1.9.1 - 3 bower jquery#>=1.4.4 cached https://github.com/jquery/jquery-dist.git#3.1.1 bower jquery#>=1.4.4 validate 3.1.1 against https://github.com/jquery/jquery-dist.git#>=1.4.4 bower jquery#^2.0.3 cached https://github.com/jquery/jquery-dist.git#2.2.4 bower jquery#^2.0.3 validate 2.2.4 against https://github.com/jquery/jquery-dist.git#^2.0.3 bower ECONFLICT Unable to find suitable version for jquery


Solution

  • Best way to start with is to do

    bower cache clean
    

    After that when you do

    bower install it will ask you

    Unable to find a suitable version for jquery, please choose one:
    1) jquery#exampleversion1 which resolved to 1.5.3 and is required by demo1
    2) jquery#^exampleversion2 which resolved to 1.5.3 and is required by app2    
    3) jquery#>.examplegversion3 which resolved to 1.5.3 and is required by app3Test
    

    then you can enter !1 or !2 , or whatever suits your needs the best.

    Prefixing number with ! essentially adds the resolution block into bower.json but it will give you more control over what's happening and it might solve your problem.