开发环境配置

编程

机器配置(mac)


xcode 命令行工具:

安装:

xcode-select --install

更新:

sudo rm -rf $(xcode-select -print-path) && xcode-select --install

Homebrew国内源配置,

参考:https://lug.ustc.edu.cn/wiki/mirrors/help/brew.git

https://lug.ustc.edu.cn/wiki/mirrors/help/homebrew-bottles#homebrew_bottles%E6%BA%90

替换及重置Homebrew默认源

替换brew.git:

cd "$(brew --repo)"

git remote set-url origin https://mirrors.ustc.edu.cn/brew.git

默认的为: https://github.com/Homebrew/brew

替换homebrew-core.git:

cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"

git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git

默认的为:https://github.com/Homebrew/homebrew-core

Homebrew Bottles源

echo "export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles" >> ~/.bash_profile

python开发环境配置


python多版本管理

git clone https://github.com/yyuu/pyenv.git ~/.pyenv

echo "export PYENV_ROOT="$HOME/.pyenv"" >> ~/.bash_profile

echo "export PATH="$PYENV_ROOT/bin:$PATH"" >> ~/.bash_profile

echo "eval "$(pyenv init -)"" >> ~/.bash_profile

source ~/.bash_profile

git clone https://github.com/pyenv/pyenv-virtualenv.git $(pyenv root)/plugins/pyenv-virtualenv

echo "eval "$(pyenv virtualenv-init -)"" >> ~/.bash_profile

source ~/.bash_profile

配置pip源,

~/.pip/pip.conf文件添加

[global]

index-url = https://mirrors.aliyun.com/pypi/simple

nodejs开发环境配置


  1. nvm 安装

curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash

  1. 配置nvm node 镜像加速源, 在.bash_profile文件中添加

export NVM_DIR="$HOME/.nvm"

[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm

[ -s "$NVM_DIR/bash_completion" ] && . "$NVM_DIR/bash_completion" # This loads nvm bash_completion

export NVM_NODEJS_ORG_MIRROR="https://npm.taobao.org/mirrors/node"

  1. npm源配置, 编辑文件 ~/.npmrc

registry=https://registry.npm.taobao.org

sass_binary_site=https://npm.taobao.org/mirrors/node-sass/

phantomjs_cdnurl=https://npm.taobao.org/mirrors/phantomjs/

electron_mirror=https://npm.taobao.org/mirrors/electron/

以上是 开发环境配置 的全部内容, 来源链接: utcz.com/z/517600.html

回到顶部