Visual Studio 2015预览版中Bower无法工作

8

我正在使用Visual Studio 2015构建一个网页应用程序,但在公司的代理服务器下安装bower包时遇到了问题。

我尝试了以下解决方法:

  1. Created a .bowerrc file in the solution with the following settings.

    {
      "proxy": "http://xxx.xxx.xxx.xxx:Port",
      "https-proxy": "http://xxx.xxx.xxx.xxx:Port",
      "strict-ssl": false
    }
    
  2. Installed Git. Changed the git configuration to use https:// instead of git://

当我运行以下命令时
bower install
我收到以下错误信息。
bower ECMDERR 执行 "git ls-remote --tags --heads https://github.com/jzaefferer/jquery-validation.git" 失败,退出码为 #128

附加错误详细信息: fatal: 无法访问 'https://github.com/jzaefferer/jquery-validation.git/': Failed connect to github.com:443; No error 有任何想法是出了什么问题吗?

似乎你的公司代理不允许你与Github通信?请验证你的代理设置。在这里,失败的命令可以正常工作。 :) - AndersNS
2个回答

1

如果您需要通过代理访问git,则需要使用代理设置设置HTTP_PROXY和HTTPS_PROXY环境变量。


443错误代码表示https SSL错误,您是否尝试直接访问URL,可能存在证书问题。 - agua from mars
我尝试直接从浏览器访问该URL,一切工作正常。 - AnandhaSundari M

0

我在VS2015 CTP中使用Bower时遇到了类似的问题。通过注释掉 bower.cmd 文件中两行代码,成功解决了这个问题:https://dev59.com/eF4b5IYBdhLWcg3wvkA-#29605933

这基本上确保了VS使用我已经安装的Git,并且遵循我的 .gitconfig 文件。显然,默认情况下它使用一个轻量级的 git.exe,不会读取 .gitconfig 文件。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接