Visual studio 2015 Visual Studio 2015 bower未安装资源

Visual studio 2015 Visual Studio 2015 bower未安装资源,visual-studio-2015,bower,Visual Studio 2015,Bower,我正在使用Visual Studio 2015,尝试使用bower安装资源时出错 这是我的bower.json: { "name": "ASP.NET", "private": true, "dependencies": { "angular": "1.4.5", "angular-resource": "1.4.5", "angular-route": "1.4.5", "jQuery": "2.1.4", "bootstrap":

我正在使用Visual Studio 2015,尝试使用bower安装资源时出错

这是我的bower.json:

{
    "name": "ASP.NET",
    "private": true,
  "dependencies": {
    "angular": "1.4.5",
    "angular-resource": "1.4.5",
    "angular-route": "1.4.5",
    "jQuery": "2.1.4",
    "bootstrap": "3.3.5"
  }
}
以下是我的错误输出:

bower angular#1.4.5         not-cached https://github.com/angular/bower-angular.git#1.4.5
bower angular#1.4.5            resolve https://github.com/angular/bower-angular.git#1.4.5
bower angular-resource#1.4.5       not-cached https://github.com/angular/bower-angular-resource.git#1.4.5
bower angular-resource#1.4.5          resolve https://github.com/angular/bower-angular-resource.git#1.4.5
bower angular-route#1.4.5          not-cached https://github.com/angular/bower-angular-route.git#1.4.5
bower angular-route#1.4.5             resolve https://github.com/angular/bower-angular-route.git#1.4.5
bower bootstrap#3.3.5              not-cached https://github.com/twbs/bootstrap.git#3.3.5
bower bootstrap#3.3.5                 resolve https://github.com/twbs/bootstrap.git#3.3.5
bower angular-resource#1.4.5         checkout v1.4.5
bower angular#1.4.5                  checkout v1.4.5
bower angular-route#1.4.5            checkout v1.4.5
bower bootstrap#3.3.5                checkout v3.3.5
bower angular-resource#1.4.5          ECMDERR Failed to execute "git clone https://github.com/angular/bower-angular-resource.git -b v1.4.5 --progress . --depth 1", exit code of #-532462766

bower的目录设置为wwwroot/lib。有人告诉我Visual Studio有一个bug,它会说Bower没有安装资源,但实际上安装了,但是我没有看到wwwroot/lib文件夹中的资源,这让我相信这不是同一个bug。

我就是这样解决的:

  • 从安装独立Git

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

    git-config——全局url。https://github.com/.insteadOf git://github.com/

  • 现在只需配置Visual studio即可使用此新的git工具:

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

希望这有帮助