snekkke snekkke - 5 days ago 5
jQuery Question

Bower in VS2015.3 download wrong version

i´m having problems with bower inside VS on an aspnet core 1.0 project. My bower.json is this



{
"name": "asp.net",
"private": true,
"dependencies": {
"bootstrap": "3.3.6",
"jquery": "2.2.4",
"jquery-validation": "1.14.0",
"jquery-validation-unobtrusive": "3.2.6"
}
}





But when I go to the libs that bower downloaded i find that jquery is v3.1.0



/*eslint-disable no-unused-vars*/
/*!
* jQuery JavaScript Library v3.1.0
* https://jquery.com/
*
* Includes Sizzle.js
* https://sizzlejs.com/
*
* Copyright jQuery Foundation and other contributors
* Released under the MIT license
* https://jquery.org/license
*
* Date: 2016-07-07T21:44Z
*/





I thought it was my machine but it happened to me in three different machines. am i doing something wrong??

Edit:
I tried with this:



{
"name": "asp.net",
"private": true,
"dependencies": {
"jquery": "~2.2.4"
},
"resolutions": {
"jquery": "<=2.2.4"
}
}





The only package configured in bower.json is jquery and still installs jquery 3.0.1. Why is bower doing that? The Output window for npm/bower says:


PATH=.\node_modules.bin;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Web\External;%PATH%;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Web\External\git
"C:\Program Files (x86)\Microsoft Visual Studio 14.0\Web\External\Bower.cmd" install --force-latest

bower jquery#~2.2.4 cached https://github.com/jquery/jquery-dist.git#2.2.4

bower jquery#~2.2.4 validate 2.2.4 against https://github.com/jquery/jquery-dist.git#~2.2.4

bower jquery extra-resolution Unnecessary resolution: jquery#<=2.2.4

bower jquery#~2.2.4 install jquery#2.2.4

jquery#2.2.4 wwwroot\bower\jquery

Answer

This is a known issue in the tooling repo:

https://github.com/aspnet/Tooling/issues/575

I simply switched to npm, which resolves the correct package version just fine.

Comments