VS 2015 + Bower:在防火墙后面不起作用 [英] VS 2015 + Bower: Does not work behind firewall

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

问题描述

在 Visual Studio 2015 中,使用 bower,我的包在防火墙后面恢复失败,错误类似于:

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

ECMDERR 执行git ls-remote --tags --heads git://github.com/jzaefferer/jquery-validation.git"失败,退出代码#-532462766

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

我已经更新了我的 git 配置以使用 http 而不是 git.当我从命令行运行时,命令成功:

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

但无论如何,Visual Studio 或其组件之一似乎都在使用 git 而不是 http.

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

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

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.

解决方案 - 在 SO 的许多其他地方都有记录(example),是运行:

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

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

我这样做了,现在我的 git config -l 看起来像:

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://

尽管如此,要么 Visual Studio/npm 不尊重我的配置,要么使用的是旧的缓存版本.

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

根据 这个关于 npm 问题的帖子,我看到了 npm(大概 bower 在 VS 中使用)使用 git@ 语法.尽管这不是我在输出中看到的,但我想我会试一试.

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.

我跑了:

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

然后我重新启动了 Visual Studio,但问题仍然存在.我读到的修复程序可能永远不适用.

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?

推荐答案

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

Same problem using VS 2015, my workaround :

  1. 安装 Git

  1. Install Git

http://git-scm.com/

在 Git Bash 中配置 Git 以使用 http 而不是 git://

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

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

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

编辑(如 g.pickardou 所指出的)您可以使用 https 来提高安全性:

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

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

配置 VS 以使用新安装的 Git 而不是 VS Git

Configure VS to use the new installed Git over VS Git

右键单击 Bower 文件夹(在依赖项下),然后选择配置外部工具"

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

取消选中$(DevEnvDir)ExtensionsMicrosoftWeb ToolsExternalgit"

Uncheck "$(DevEnvDir)ExtensionsMicrosoftWeb ToolsExternalgit"

用C:Program Files (x86)Gitin"添加一个新节点

Add a new node with "C:Program Files (x86)Gitin"

希望这对某人有所帮助,

Hope this will help someone,

罗杰里奥

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

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