VS 2015 + Bower: Does not work behind firewall

前端 未结 12 2205
一向
一向 2020-11-29 01:40

Problem

In Visual Studio 2015, using bower, my package restores fail when behind a firewall with an error similar to:

ECMDERR Failed to exec

12条回答
  •  失恋的感觉
    2020-11-29 02:21

    I had the same problem. Apparently the Git.exe that VS2015 CTP ships with does not use .gitconfig. But you can fix it (manually), if you have the git command line tools installed elsewhere.

    In C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\Web Tools\External you will need to edit the file bower.cmd.

    Comment out lines 4 and 5:

    rem -- set GIT_PATH=%~dp0\git
    rem -- set PATH=%GIT_PATH%;%PATH%`
    

    This will trigger the command to use the Git you have already installed, which will pick up the local .gitconfig.

    Make sure you have set the appropriate git setting:

    git config --global url."http://".insteadOf git://
    

提交回复
热议问题