visual-studio-2015 - 如何在代理后面为 Visual Studio 配置 npm、git 和 bower

标签 visual-studio-2015 npm proxy visual-studio-2017 bower

如何正确配置 Visual Studio 工具以在代理后工作?

最佳答案

为 npm 包管理器配置代理设置

  • 关闭 Visual Studio。
  • 打开 Visual Studio 开发人员命令窗口(转到开始菜单 -> 在文件夹 Visual Studio XXXX -> 开发人员命令提示符)
  • 在 Visual Studio 开发人员命令窗口中,键入以下命令:npm config set proxy http://proxyuser:proxypwd@proxy.server.com:8080 .
  • 然后输入这个命令:npm config set https-proxy http://proxyuser:proxypwd@proxy.server.com:8080 .
  • 打开 Visual Studio。

  • 为 git 配置代理设置
  • 关闭 Visual Studio。
  • 打开 Visual Studio 开发人员命令窗口(转到开始菜单 -> 在文件夹 Visual Studio XXXX -> 开发人员命令提示符)
  • 在 Visual Studio 开发人员命令窗口中,键入以下命令:git config --global http.proxy http://proxyuser:proxypwd@proxy.server.com:8080 .
  • 输入此命令:git config --global https.proxy http://proxyuser:proxypwd@proxy.server.com:8080 .
  • 打开 Visual Studio。

  • 为 Bower 配置代理设置
  • 关闭 Visual Studio。
  • 导航到用户目录(在资源管理器的路径中键入 %UserProfile%)
  • 创建文件 .bowerrc(输入“.bowerrc.”作为文件名)

  • { 
      "registry": "http://bower.herokuapp.com", 
      "proxy": "http://proxyuser:proxypwd@proxy.server.com:8080", 
      "https-proxy": "http://proxyuser:proxypwd@proxy.server.com:8080"
    }
    
  • 保存文件
  • 打开 Visual Studio。

  • 警告 :如果您的代理密码中有特殊字符,则必须对代理 url 进行编码。例子:
  • 用户名 : 域\用户名
  • 密码 : P@$$w0rd
  • 代理服务器 : 10.80.0.0
  • 代理端口 : 8080
  • 代理网址 带认证: http://DOMAIN%5Cuser+name%3AP%40%24%24w0rd@10.80.0.0:8080

  • 等等 :)

    关于visual-studio-2015 - 如何在代理后面为 Visual Studio 配置 npm、git 和 bower,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41038067/

    相关文章:

    windows - 使用 NDIS 驱动程序的自定义事件消息

    visual-c++ - 构建 OpenSSL 时为 "Compiling Desktop applications for the ARM platform is not supported"

    npm - 未满足对等依赖 babel-core@5.8.38

    ubuntu - gem install 返回 FloatDomainError Infinity 或 NaN

    nginx 反向代理图片和 css 未加载

    android - 强制 Gradle 使用 HTTP 而不是 HTTPS

    c# - msbuild 命令行尚不支持 WebPublishMethod(FileSystem)

    visual-studio-2015 - Visual Studio 2015 JSX/ES2015 语法高亮

    api - Urturn API : command not found

    Windows 安装 PhantomJS 失败