凉亭:安装jquery 1x和2x

时间:2014-05-02 21:02:52

标签: jquery bower

我通过凉亭安装了jquery ver 2。现在试图获得最新的1.x(1.11.1)。但是,它没有提供该选项

bower install jquery --save
bower jquery#*                  cached git://github.com/jquery/jquery.git#2.1.0
bower jquery#*                validate 2.1.0 against git://github.com/jquery/jquery.git#*
bower jquery#*                     new version for git://github.com/jquery/jquery.git#*
bower jquery#*                 resolve git://github.com/jquery/jquery.git#*
bower jquery#*                download https://github.com/jquery/jquery/archive/2.1.1.tar.gz
bower jquery#*                 extract archive.tar.gz
bower jquery#*                resolved git://github.com/jquery/jquery.git#2.1.1
bower jquery#>=1.8.0            cached git://github.com/jquery/jquery.git#2.1.1
bower jquery#>=1.8.0          validate 2.1.1 against git://github.com/jquery/jquery.git#>=1.8.0

Unable to find a suitable version for jquery, please choose one:
    1) jquery#1.8.3 which resolved to 1.8.3 and is required by angular-file-upload#0.3.1 
    2) jquery#>=1.8.0 which resolved to 2.1.1 and is required by angular-gettext#0.2.8 
    3) jquery#~2.1.1 which resolved to 2.1.1

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

[?] Answer: 

我的bower.json的一部分看起来像

{

  "dependencies": {
    "angular-bootstrap": "~0.10.0",
    "angular-file-upload": "~0.3.1",
    ....
  },
  "devDependencies": {
    "jquery2": "jquery#2",
    "sinon-chai": "~2.5.0",
    "sinon": "~1.9.1"
  }
}

1 个答案:

答案 0 :(得分:10)

this answer

怎么样?

bower install jquery-legacy=jquery#^1 jquery-modern=jquery