VS 2015 + Bower:不适用于防火墙 [英] VS 2015 + Bower: Does not work behind firewall

查看:117
本文介绍了VS 2015 + Bower:不适用于防火墙的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在使用bower的Visual Studio 2015中,当防火墙出现类似以下错误时,我的软件包恢复失败:
$
b $ b


ECMDERR无法执行git ls-remote --tags - heads git://github.com/jzaefferer/jquery-validation.git,退出# 532462766

我已经更新了我的git配置,使用 http 代替git。当我从命令行运行时,该命令成功:





但是Visual Studio或者其中的一个组件似乎正在使用 git http 不管。



背景&第一次尝试解决



使用Visual Studio 2015和Bower进行包管理。当它不在防火墙后面时,它很好用,但是在防火墙后面,我不能使用 git:// 协议。



<解决方案 - 在许多其他地方记录在SO上(示例)是运行:

  git config --global url。http://.insteadOf git:// 

我这样做了,现在我的 git config -l <​​/ code>看起来例如:

  ore.symlinks = false 
core.autocrlf = true
color.diff = auto
color.status = auto
color.branch = auto
color.interactive = true
pack.packsizelimit = 2g
help.format = html
http。 sslcainfo = / bin / curl-ca-bundle.crt
sendemail.smtpserver = / bin / msmtp.exe
diff.astextplain.textconv = astextplain
rebase.autosquash = true
user.name = Sean Killeen
user.email=SeanKilleen@gmail.com
url.http://.insteadof=git://

但是尽管如此,eit她的Visual Studio / npm不尊重我的配置,或者使用旧的缓存版本。



第二次尝试解决



根据关于npm问题的此线索,我看到npm(这可能是在VS中使用的)使用 git @ 语法。尽管这不是我在输出中看到的,但我认为我会付出一些努力。



我跑了:

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

然后重新启动Visual Studio,但问题仍然存在。我读过的修复可能永远不会适用。



关于如何解决的任何想法?

解决方案

使用VS 2015的同样的问题,我的解决方法:


$ b


  1. 安装Git



    http://git-scm.com/


  2. 配置Git使用http代替git://使用Git Bash



    git config --global url。http:// .insteadOf git://



    编辑(正如g.pickardou指出的那样),您可以使用https来更安全:



    git config --global url。 https ://.insteadOf git://




  3. 右键单击Bower文件夹(依赖项下),然后选择配置外部工具 / p>

    取消选中$(DevEnvDir)\Extensions\Microsoft\Web Tools\External\git



    <使用C:\\ Program Files Fi添加一个新节点les(x86)\Git\bin


希望这能帮助别人,



Rogerio


Problem

In Visual Studio 2015, using bower, my package restores fail when behind a firewall with an error similar to:

ECMDERR Failed to execute "git ls-remote --tags --heads git://github.com/jzaefferer/jquery-validation.git", exit code of #-532462766

I have updated my git config to use http instead of git. When I run from my command line, the command is successful:

But Visual Studio or one of its components appears to be using git instead of http regardless.

Background & First Attempt to Resolve

Using Visual Studio 2015 and Bower for package management. It works great when not behind a firewall, but when behind a firewall I cannot use the git:// protocol.

The solution -- documented in many other places on SO (example), is to run:

git config --global url."http://".insteadOf git://

I did this, and now my git config -l looks like:

ore.symlinks=false
core.autocrlf=true
color.diff=auto
color.status=auto
color.branch=auto
color.interactive=true
pack.packsizelimit=2g
help.format=html
http.sslcainfo=/bin/curl-ca-bundle.crt
sendemail.smtpserver=/bin/msmtp.exe
diff.astextplain.textconv=astextplain
rebase.autosquash=true
user.name=Sean Killeen
user.email=SeanKilleen@gmail.com
url.http://.insteadof=git://

But despite this, either Visual Studio / npm is not respecting my configuration, or is using an old, cached version of it.

Second Attempt to Resolve

Per this thread on npm issue, I saw that npm (which presumably bower is using in VS) uses the git@ syntax. Even though this isn't what I saw in the output, I figured I'd give it a shot.

I ran:

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

I then restarted Visual Studio, but the issue still persists. The fix I'd read about was likely never applicable.

Any ideas on how to fix?

解决方案

Same problem using VS 2015, my workaround :

  1. Install Git

    http://git-scm.com/

  2. Configure Git to use http instead of git:// with Git Bash

    git config --global url."http://".insteadOf git://

    Edit (as pointed by g.pickardou) you can use https to be more secure:

    git config --global url."https://".insteadOf git://

  3. Configure VS to use the new installed Git over VS Git

    Right click on Bower folder (under Dependencies), then select "Configure external tools"

    Uncheck "$(DevEnvDir)\Extensions\Microsoft\Web Tools\External\git"

    Add a new node with "C:\Program Files (x86)\Git\bin"

Hope this will help someone,

Rogerio

这篇关于VS 2015 + Bower:不适用于防火墙的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆