git,npm,bower设置代理地址

Posted Nyan

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了git,npm,bower设置代理地址相关的知识,希望对你有一定的参考价值。

我們先假設代理伺服器的位址為:

  • http://10.0.0.1:8080

設定 Git 使用代理伺服器

輸入兩行指令即可設定完畢:

  • git config --global https.proxy http://10.0.0.1:8080
  • git config --global http.proxy http://10.0.0.1:8080
  • git config --global http.sslVerify false

取消設定 Proxy 的方法:

  • git config --global --unset http.proxy
  • git config --global --unset https.proxy
  • git config --global --unset http.sslVerify

參考資料

設定 npm 使用代理伺服器

輸入兩行指令即可設定完畢:

  • npm config set https-proxy http://10.0.0.1:8080
  • npm config set proxy http://10.0.0.1:8080
  • npm config set strict-ssl false

取消設定 Proxy 的方法:

  • npm config delete https-proxy
  • npm config delete proxy
  • npm config delete strict-ssl

參考資料

 

設定 Bower 使用代理伺服器

請建立一個 %UserProfile%\.bowerrc 檔案 ( 若為 Mac OS X 請建立 ~/.bowerrc 檔案 ),其內容如下:

{
 "registry":"http://10.0.0.1:8080"
"proxy": "http://10.0.0.1:8080",
"https-proxy": "http://10.0.0.1:8080", "strict-ssl": false }

取消設定 Proxy 只要將 %UserProfile%\.bowerrc 檔案刪除即可。

以上是关于git,npm,bower设置代理地址的主要内容,如果未能解决你的问题,请参考以下文章

NPM, BOWER, GIT, AND BASH PROXY CONFIGURATIONS

sh 系统,Git,Git LFS,NPM,Grunt,Bower和ngrok的bash函数和别名

bower的下载安装及使用

Mac 安装Bower

Mac安装Bower

什么是bower