开发环境配置(python, nodejs)

∥☆過路亽.° 提交于 2020-08-05 12:00:40

机器配置(本人mac, 其他linux系统玩下看)


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/
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!