J. Doe
J. Doe

Reputation: 687

Cannot install bower packages in my new ASP.NET application

I have just created my first asp.net 6 project.

However, whenever I try to install a bower package I get the following error (happens to all packages I attempt to install):

PATH=.\node_modules.bin;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\Web Tools\External;%PATH%;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\Web Tools\External\git "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\Web Tools\External\Bower.cmd" install Jcrop#2.0.2 --production --force-latest --save bower Jcrop#2.0.2 not-cached https://github.com/tapmodo/Jcrop.git#2.0.2 bower Jcrop#2.0.2
resolve https://github.com/tapmodo/Jcrop.git#2.0.2 bower Jcrop#2.0.2
checkout v2.0.2 bower Jcrop#2.0.2 ECMDERR Failed to execute "git clone https://github.com/tapmodo/Jcrop.git -b v2.0.2 --progress . --depth 1", exit code of #-532462766

I have looked at the thread: VS 2015 + Bower: Does not work behind firewall

I have tried to disable my firewall and create a .gifconfig file in my user directory containing:

[url "https://github.com/"]
    insteadOf = [email protected]:
[url "https://"]
    insteadOf = git://

But nothing seems to work - I still get the error!

(I don't have git installed, other than what came with Visual Studio 2015)

Upvotes: 1

Views: 386

Answers (2)

Rydell
Rydell

Reputation: 4207

In a nutshell, what worked for me is to install git from git-scm and have Visual Studio work with that instead of what comes pre-installed.

  • Download and install git from https://git-scm.com/downloads/win
    • Note that I needed to exit VS before installation
  • Configure VS to use the new version of git
    • In VS Solution Explorer right click on the Bower folder under dependencies and click on 'Configure External Tools...'
    • Uncheck the existing $(DevEnvDir)...\git tool
    • Add a new path to \Program Files\Git\bin
    • Click Ok

Good Luck....

Upvotes: 2

Negorath
Negorath

Reputation: 486

I was having the same issue, but I was able to fix it by following the link you provided, but you're missing a critical step: you need to install Git yourself and configure VS to use that instead.

Upvotes: 0

Related Questions