3

I have jquery ver 2 is installed through bower. Now trying to get latest 1.x (1.11.1). But, it doesn't give that option

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: 

Part of my bower.json looks like

{

  "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"
  }
}
bsr
  • 57,282
  • 86
  • 216
  • 316
  • 1
    Is this for production code? you really should be blanket including "latest version of jquery" in production code. it's better to set it to a specific version to avoid problems down the road. – Kevin B May 02 '14 at 21:13
  • Thanks for pointing it out. jquery is only for testing. I admit, I don't split the dependency and specify dependency well. But atleast during development, I like to keep up with the latest release, until I ready to release. – bsr May 02 '14 at 21:18
  • wish i didn't typo that comment, haha. that should be "shouldn't". :) – Kevin B May 02 '14 at 21:25

1 Answers1

10

How about this answer:

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

Community
  • 1
  • 1
Sean DeNigris
  • 6,306
  • 1
  • 31
  • 37