VS 2015 + Bower:在防火墙后面不起作用

编程入门 行业动态 更新时间:2024-10-23 19:20:51
本文介绍了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/jzaefferer/jquery-validation.git"失败,退出代码#-532462766

ECMDERR Failed to execute "git ls-remote --tags --heads git://github/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."".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 url..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."github/".insteadOf git@github:

然后我重新启动了 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 :

  • 安装 Git

  • Install Git

    git-scm/

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

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

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

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

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

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

    git config --global url."".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:在防火墙后面不起作用

    本文发布于:2023-06-11 17:28:49,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/639766.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:防火墙   不起作用   Bower

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!