Skip to content
This repository has been archived by the owner on Apr 11, 2020. It is now read-only.

Bower.cmd is run with --force-latest flag #665

Open
kevinharing opened this issue Jul 11, 2016 · 7 comments
Open

Bower.cmd is run with --force-latest flag #665

kevinharing opened this issue Jul 11, 2016 · 7 comments

Comments

@kevinharing
Copy link

kevinharing commented Jul 11, 2016

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

@kevinharing kevinharing changed the title Bower.cmd is run with --fore-latest flag Bower.cmd is run with --force-latest flag Jul 11, 2016
@ghost
Copy link

ghost commented Jul 12, 2016

I'm facing the same issue. Related: #575

@TravisBoatman
Copy link

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

bower install jQuery#2.2.4 --save

@mlorbetske
Copy link

TFS Bug#241382

@chapeti
Copy link

chapeti commented Oct 7, 2016

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.

@Elyseum
Copy link

Elyseum commented Oct 11, 2016

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

@denisz1
Copy link

denisz1 commented Oct 21, 2016

+1 bugfix please fix bower.cmd

@fantastik78
Copy link

Is there any update on this issue ?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants