bower ECONFLICT即使添加了分辨率,也无法找到合适的jquery错误版本

时间:2017-03-06 06:13:08

标签: javascript angularjs bower bower-install

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

bower安装angular-peity --save

bower angular-peity#* cached https://github.com/projectweekend/angular-peity.git#0.0.5 bower angular-peity#*验证0.0.5对https://github.com/projectweekend/angular-peity.git# * bower peity#* cached https://github.com/benpickles/peity.git#3.2.1 bower peity#*验证3.2.1对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对https://github.com/jquery/jquery-dist.git#~2.0.3验证2.0.3 bower jquery#> = 1.6缓存https://github.com/jquery/jquery-dist.git#3.1.1 bower jquery#> = 1.6验证3.1.1对https://github.com/jquery/jquery-dist.git#> = 1.6 bower jquery#> = 1.7缓存https://github.com/jquery/jquery-dist.git#3.1.1 bower jquery#> = 1.7验证3.1.1对https://github.com/jquery/jquery-dist.git#> = 1.7 bower jquery#1.9.1 - 3缓存https://github.com/jquery/jquery-dist.git#3.1.1 bower jquery#1.9.1 - 3验证3.1.1对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验证3.1.1对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验证2.2.4对https://github.com/jquery/jquery-dist.git# ^ 2.0.3 凉亭ECONFLICT无法找到合适的jquery版本

2 个答案:

答案 0 :(得分:3)

最好的方法是做

bower cache clean

之后当你做

bower install它会问你

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

然后您可以输入!1!2,或者最适合您需要的任何内容。

使用!添加前缀数字实际上会将解决方案块添加到bower.json中,但它可以让您更好地控制发生的事情,并可能解决您的问题。

答案 1 :(得分:2)

我在使用Git Bash for Windows

的Windows 10上遇到了同样的错误
  

ECONFLICT无法为jquery

找到合适的版本

并且它没有进入我可以选择选项!1!2

的部分

对我来说,切换到Windows PowerShell解决了问题并运行相同的命令bower install

我怀疑它已与用户权限相关联。