VS 2015 + Bower: Does not work behind firewall

前端 未结 12 2237
一向
一向 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:44

    I had this same problem in Visual Studio 2015 RC (not CTP). Since this is the only relevant thread I found anywhere, figured I'd add my 2c here.

    Expanding on @MagicMau's answer, the lines in bower.cmd referenced don't exist in 2015 RC, so I took a different approach and set the PATH env variable, so that my entire bower.cmd file now looks like this:

    set PATH=C:\Program Files (x86)\Git\bin\;%PATH%
    @"%~dp0\node\node" "%~dp0\bower\node_modules\bower\bin\bower" %*
    

    Note that the first line is what I added, and the second line was the existing content.

    The first time I did this, Visual Studio crashed during package restore, but seems to be working after a restart of VS.

提交回复
热议问题