【问题标题】:Bower is failing with VS 2015Bower 在 VS 2015 上失败了
【发布时间】:2016-04-23 08:52:49
【问题描述】:

上下文:

我正在尝试在我的 VS 2015 Update 2 ASP.NET 4.6 项目中使用 bower。 Bower 已成功(?)通过项目下的 npm 安装。创建保存bower.json后,有git相关的错误信息。 (见展览)

注意:

这不是协议更改问题 (git:// -> https://)。 协议已经是 https。

问题:

如何配置 bower 以使用我的 VS 2015 ASP Web 应用程序。

凉亭输出展示:

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 --force-latest
bower jquery-validation-unobtrusive#*       not-cached https://github.com/aspnet/jquery-validation-unobtrusive.git#*
bower jquery-validation-unobtrusive#*          resolve https://github.com/aspnet/jquery-validation-unobtrusive.git#*
bower modernizr#*                           not-cached https://github.com/Modernizr/Modernizr.git#*
bower modernizr#*                              resolve https://github.com/Modernizr/Modernizr.git#*
bower bootstrap#*                           not-cached https://github.com/twbs/bootstrap.git#*
bower bootstrap#*                              resolve https://github.com/twbs/bootstrap.git#*
bower jquery-validation-unobtrusive#*         checkout v3.2.6
bower modernizr#*                             checkout v3.3.1
bower bootstrap#*                             checkout v3.3.6
bower jquery-validation-unobtrusive#*          ECMDERR Failed to execute "git clone https://github.com/aspnet/jquery-validation-unobtrusive.git -b v3.2.6 --progress . --depth 1", exit code of #-532462766

【问题讨论】:

  • 您好,您是在创建 bower.json 文件吗?
  • 是的。这就是为什么您会看到 bower 输出。

标签: git visual-studio bower


【解决方案1】:

尝试更新您的 git 版本 (https://git-scm.com/),只需下载最新的二进制文件,确保 VS 已关闭,然后安装。

在安装时选择 Windows 控制台 而不是 MinTTY(没有尝试过其他方式)

然后启动 VS 并恢复 bower 包

这帮助我在安装 ASP.NET MVC 6 Boilerplate 时解决了与您相同的错误(在 VS 2015 Enterprise + ASP.NET Core RC1 上)

【讨论】:

    【解决方案2】:

    确保该目录中存在名为“.bowerrc”的 bower.json 文件

    它的内容应该是:

    { “目录”:“wwwroot/lib” }

    这为我修好了! :)

    【讨论】:

    • 谢谢。线路存在,导演也存在。
    【解决方案3】:

    不知道为什么会这样,但这就是我解决它的方法:

    • 安装来自http://git-scm.com/的独立Git

    • 打开 bash 并执行 以在 git 上使用 https(防火墙可能会阻止 git 协议):

      git config --global url.https://github.com/.insteadOf git://github.com/

    • 配置 Visual Studio 改为使用这个新的 git 工具:

      添加最后一行并取消选中旧的 git 命令行。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-11-27
      • 1970-01-01
      • 2016-08-21
      • 1970-01-01
      • 2016-11-18
      • 1970-01-01
      • 1970-01-01
      • 2015-11-01
      相关资源
      最近更新 更多