Tooling: Bower.cmd is run with --force-latest flag

Created on 11 Jul 2016  路  7Comments  路  Source: aspnet/Tooling

I'm trying to use ASP.NET Core with NPM, Bower and Gulp. In the Bower config file I set the jQuery version to 2.2.3, but the compiler runs the Bower.cmd with the flag --force-latest. This installs the latest jQuery version 3.1.0, causing incompatibilities with Bootstrap 3.6. As of now I see no way to work around this.

Log:

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 jquery#2.2.3 --force-latest --save bower jquery#>=1.8 cached https://github.com/jquery/jquery-dist.git#3.1.0 bower jquery#>=1.8 validate 3.1.0 against https://github.com/jquery/jquery-dist.git#>=1.8 bower jquery#~2.2.3 cached https://github.com/jquery/jquery-dist.git#2.2.4 bower jquery#~2.2.3 validate 2.2.4 against https://github.com/jquery/jquery-dist.git#~2.2.3 bower jquery#1.9.1 - 2 cached https://github.com/jquery/jquery-dist.git#2.2.4 bower jquery#1.9.1 - 2 validate 2.2.4 against https://github.com/jquery/jquery-dist.git#1.9.1 - 2 bower jquery#2.2.3 cached https://github.com/jquery/jquery-dist.git#2.2.3 bower jquery#2.2.3 validate 2.2.3 against https://github.com/jquery/jquery-dist.git#2.2.3 bower jquery#>= 1.7.2 cached https://github.com/jquery/jquery-dist.git#3.1.0 bower jquery#>= 1.7.2 validate 3.1.0 against https://github.com/jquery/jquery-dist.git#>= 1.7.2 bower jquery extra-resolution Unnecessary resolution: jquery#>= 1.7.2 bower font-awesome extra-resolution Unnecessary resolution: font-awesome#4.6.1 bower jquery#2.2.3 install jquery#2.2.3 jquery#2.2.3 wwwroot\lib\jquery

TFS Tracked

Most helpful comment

I got this issue 'fixed' by switching to a windows installed GIT instead of using the VS one. See http://stackoverflow.com/questions/37584520/bootstrap-3-3-6-jquery-2-2-4-version-exception/38460014#38460014

All 7 comments

I'm facing the same issue. Related: https://github.com/aspnet/Tooling/issues/575

I just experienced this issue myself. As a work around you can open command prompt and use:

bower install jQuery#2.2.4 --save

TFS Bug#241382

Another temporal hack, could be change the contents of bower.cmd to remove the --force-latest string from parameters list.

The file bower.cmd on my Visual Studio 2015.3 installation is located on C:\Program Files (x86)\Microsoft Visual Studio 14.0\Web\External.

You should replace:

@"%~dp0\node" "%~dp0\node_modules\bower\bin\bower" %*

With:

ECHO OFF
set params=%*
ECHO %params% | %WINDIR%\system32\FIND "--force-latest" >nul & 
IF ERRORLEVEL 0 (call set params=%%params:--force-latest=%%%)
@"%~dp0\node" "%~dp0\node_modules\bower\bin\bower" %params%

The above piece of code will check parameters and, if --force-latest exists, will be removed and then execute bower with cleared parameters string.

I got this issue 'fixed' by switching to a windows installed GIT instead of using the VS one. See http://stackoverflow.com/questions/37584520/bootstrap-3-3-6-jquery-2-2-4-version-exception/38460014#38460014

+1 bugfix please fix bower.cmd

Is there any update on this issue ?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

TheRealPiotrP picture TheRealPiotrP  路  8Comments

Bartmax picture Bartmax  路  5Comments

ivalexa picture ivalexa  路  3Comments

GregoryOtt picture GregoryOtt  路  4Comments

mikebm picture mikebm  路  8Comments