nvm
打开nvm安装目录,找到settings.txt文件,在最后添加一下参数
node_mirror:https://npm.taobao.org/mirrors/node/
npm_mirror: https://npm.taobao.org/mirrors/npm/
pip
linux
位置:~/.pip/pip.conf
windows
位置:%HOMEPATH%\pip\pip.ini
[global]
trusted-host = mirrors.aliyun.com
index-url = https://mirrors.aliyun.com/pypi/simple
npm
配置taobao镜像
windows
位置:%HOMEPATH%\.npmrc
npm config set registry https://registry.npm.taobao.org --global
npm config set disturl https://npm.taobao.org/dist --global
npm config set ELECTRON_MIRROR http://npm.taobao.org/mirrors/electron/ --global
npm config set CHROMEDRIVER_CDNURL https://npm.taobao.org/mirrors/chromedriver --global
npm config set ELECTRON_BUILDER_BINARIES_MIRROR https://npm.taobao.org/mirrors/electron-builder-binaries/ --global
npm install electron@16.0.7
node 16.16.0 中报如下警告:
《npm WARN config global--global
,--local
are deprecated. Use--location=global
instead.`
–location=global》
所以修改配置如下:
npm config set registry https://registry.npm.taobao.org --location=global
npm config set disturl https://npm.taobao.org/dist --location=global
npm config set ELECTRON_MIRROR http://npm.taobao.org/mirrors/electron/ --location=global
npm config set CHROMEDRIVER_CDNURL https://npm.taobao.org/mirrors/chromedriver --location=global
npm config set ELECTRON_BUILDER_BINARIES_MIRROR https://npm.taobao.org/mirrors/electron-builder-binaries/ --location=global
解决fatal: unable to connect to git://github.com问题
git config --global url."https://".insteadOf git://
解决fatal: unable to connect to github.com问题
# 设置代理
git config --global http.proxy 'socks5://127.0.0.1:1080'
git config --global https.proxy 'socks5://127.0.0.1:1080'
# 取消代理
git config --global --unset http.proxy
git config --global --unset https.proxy
maven
windows
位置:%HOMEPATH%\.m2\settings.xml
<mirrors>
<mirror>
<id>alimaven</id>
<mirrorOf>central</mirrorOf>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
</mirror>
</mirrors>
git
设置git账号和密码
- 避免每次换机器得配置各种账号密码
- 可以一次性配置多个服务器
- 【缺点】:安全性差
windows
位置:%HOMEPATH%\_netrc
设置git全局信息
git config --global credential.helper store
git config --global user.email "你的邮箱"
git config --global user.name "你的github用户名"
machine gitee.com
login kinghzking****
password 123456789Kkk
machine github.com
login kinghzking****
password 123456789Kkk
electron
npm config set registry https://registry.npm.taobao.org
npm config set ELECTRON_MIRROR http://npm.taobao.org/mirrors/electron/
npm config set CHROMEDRIVER_CDNURL https://npm.taobao.org/mirrors/chromedriver
npm config set ELECTRON_BUILDER_BINARIES_MIRROR https://npm.taobao.org/mirrors/electron-builder-binaries/
npm install electron@16.0.7
github
github 镜像站文章来源:https://www.toymoban.com/news/detail-579741.html
- gitclone.com
- https://hub.fastgit.xyz
https://hub.fastgit.org- github.do
- ghproxy.com
- hub.0z.gs
git clone https://hub.fastgit.xyz/ossrs/srs-gb28181.git
# 查看设置列表
git config --global --list
# 设置config
git config --global url."https://hub.fastgit.xyz/".insteadOf "https://github.com/"
git config --global url."https://".insteadOf "git://"
git config protocol.https.allow always
# 取消设置
git config --global --unset url."https://hub.fastgit.xyz/".insteadOf
brew
替换为阿里源文章来源地址https://www.toymoban.com/news/detail-579741.html
# 查看 brew.git 当前源
$ cd "$(brew --repo)" && git remote -v
origin https://github.com/Homebrew/brew.git (fetch)
origin https://github.com/Homebrew/brew.git (push)
# 查看 homebrew-core.git 当前源
$ cd "$(brew --repo homebrew/core)" && git remote -v
origin https://github.com/Homebrew/homebrew-core.git (fetch)
origin https://github.com/Homebrew/homebrew-core.git (push)
# 修改 brew.git 为阿里源
$ git -C "$(brew --repo)" remote set-url origin https://mirrors.aliyun.com/homebrew/brew.git
# 修改 homebrew-core.git 为阿里源
$ git -C "$(brew --repo homebrew/core)" remote set-url origin https://mirrors.aliyun.com/homebrew/homebrew-core.git
# zsh 替换 brew bintray 镜像
$ echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.aliyun.com/homebrew/homebrew-bottles' >> ~/.zshrc
$ source ~/.zshrc
# bash 替换 brew bintray 镜像
$ echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.aliyun.com/homebrew/homebrew-bottles' >> ~/.bash_profile
$ source ~/.bash_profile
# 刷新源
$ brew update
参考资料
- pip设置阿里云的镜像源,速度飞快 https://blog.csdn.net/a249040113/article/details/81567430
- brew设置国内源 https://zhuanlan.zhihu.com/p/404417025
到了这里,关于【高效】开发过程中常见配置(pip、npm、maven、git等各种国内源)的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!