javascript ECONFLICT 无法为 jquery Foundation 找到合适的版本

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/28469163/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-28 09:01:46  来源:igfitidea点击:

ECONFLICT Unable to find suitable version for jquery Foundation

javascriptjqueryjsonzurb-foundationbower

提问by Usman Tahir

I am trying to install Foundation but its continuously giving me conflict with Jquery

我正在尝试安装 Foundation,但它不断让我与 Jquery 发生冲突

λ bower install foundation
bower foundation#x              cached https://github.com/zurb/bower-foundation.git#5.5.1
bower foundation#x            validate 5.5.1 against https://github.com/zurb/bower-foundation.git#x
bower foundation#*              cached https://github.com/zurb/bower-foundation.git#5.5.1
bower foundation#*            validate 5.5.1 against https://github.com/zurb/bower-foundation.git#*
bower jquery#>= 2.1.0           cached https://github.com/jquery/jquery.git#2.1.3
bower jquery#>= 2.1.0         validate 2.1.3 against https://github.com/jquery/jquery.git#>= 2.1.0
bower modernizr#>= 2.7.2        cached https://github.com/Modernizr/Modernizr.git#2.8.3
bower modernizr#>= 2.7.2      validate 2.8.3 against https://github.com/Modernizr/Modernizr.git#>= 2.7.2
bower jquery.cookie#~1.4.0      cached https://github.com/carhartl/jquery-cookie.git#1.4.1
bower jquery.cookie#~1.4.0    validate 1.4.1 against https://github.com/carhartl/jquery-cookie.git#~1.4.0
bower fastclick#>=0.6.11        cached https://github.com/ftlabs/fastclick.git#1.0.6
bower fastclick#>=0.6.11      validate 1.0.6 against https://github.com/ftlabs/fastclick.git#>=0.6.11
bower jquery-placeholder#~2.0.7 cached https://github.com/mathiasbynens/jquery-placeholder.git#2.0.9
bower jquery-placeholder#~2.0.7         validate 2.0.9 against https://github.com/mathiasbynens/jquery-placeholder.git#~2.0.7
bower                                  ECONFLICT Unable to find suitable version for jquery

My bower.json file is this

我的 bower.json 文件是这样的

{
  "name": "refactor",
  "private": true,
  "dependencies": {
    "jquery": "~1.11.1",
    "raphael": "1.3.x",
    "font-awesome": "~4.3.0",
    "foundation": "x"
  }
}

回答by esbanarango

Use resolutionsin your bower.json

使用resolutions您的bower.json

{
  "name": "refactor",
  "private": true,
  "dependencies": {
    "jquery": "~1.11.1",
    "raphael": "1.3.x",
    "font-awesome": "~4.3.0",
    "foundation": "x"
  },
  "resolutions": {
    "jquery": "~1.11.1"
  }
}

This will force bower to use that specific version of jQuery.

这将强制 bower 使用该特定版本的 jQuery。

回答by manntsheth

Best way to start with is to do

最好的开始方式是做

bower cache clean

After that when you do

之后当你做

bower installit will ask you

bower install它会问你

'Unable to find a suitable version for <Your Dependency Name>, please choose one:,

'Unable to find a suitable version for <Your Dependency Name>, please choose one:,

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

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

This essentially adds the resolution block into bower.json as mentioned by @esbanarango but it just gives more control and understanding over what you are doing.

这实际上将解析块添加到 @esbanarango 提到的 bower.json 中,但它只是提供了对您正在做什么的更多控制和理解。

回答by Hossein Jabbari

Try using this for the Jquery version:

尝试将其用于 Jquery 版本:

"jquery": ">= 2.0.0"

However I think you would only need Foundation as a dependency:

但是我认为您只需要 Foundation 作为依赖项:

enter image description here

在此处输入图片说明

or:

或者:

{
    "name": "PROJECT_NAME",
    "dependencies": {
       "foundation": "~5.4.7"
    }
} 

also check here for more details:

还可以在此处查看更多详细信息:

http://foundation.zurb.com/docs/sass.html

http://foundation.zurb.com/docs/sass.html