无法在我的新ASP.NET应用程序中安装bower软件包

时间:2016-04-07 15:14:07

标签: git visual-studio github visual-studio-2015 bower

我刚刚创建了我的第一个asp.net 6项目。

但是,每当我尝试安装bower软件包时,都会收到以下错误(发生在我尝试安装的所有软件包中):

  

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"安装Jcrop#2.0.2 --production --force-latest --save bower   Jcrop#2.0.2没有缓存   https://github.com/tapmodo/Jcrop.git#2.0.2凉亭Jcrop#2.0.2
  解决https://github.com/tapmodo/Jcrop.git#2.0.2 bower Jcrop#2.0.2
  checkout v2.0.2 bower Jcrop#2.0.2 ECMDERR失败   执行" git clone https://github.com/tapmodo/Jcrop.git -b v2.0.2    - 进步。 --depth 1&#34 ;,退出代码#-532462766

我看了一下帖子: VS 2015 + Bower: Does not work behind firewall

我尝试禁用防火墙并在包含以下内容的用户目录中创建.gifconfig文件:

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

但似乎没有任何作用 - 我仍然得到错误!

(除了Visual Studio 2015附带的内容之外,我没有安装git)

2 个答案:

答案 0 :(得分:2)

简而言之,对我有用的是从git-scm安装git并让Visual Studio使用它而不是预装的。

  • https://git-scm.com/downloads/win下载并安装git
    • 请注意,我需要在安装前退出VS
  • 配置VS以使用新版本的git
    • 在VS Solution Explorer中右键单击依赖项下的Bower文件夹,然后单击“配置外部工具...”
    • 取消选中现有的$(DevEnvDir)... \ git工具
    • 向\ Program Files \ Git \ bin
    • 添加新路径
    • 点击确定

祝你好运....

答案 1 :(得分:0)

我遇到了同样的问题,但我可以通过关注您提供的链接来修复它,但是您错过了关键步骤:您需要自己安装Git并配置VS以使用它。< / p>