在 macOS 配置前端开发环境。
目录
Git
1 | git --version |
Iterm2

Homebrew
为加速安装,先进行 Git 代理配置:
- 加速 ssh 协议的 clone,修改/新增文件:
~/.ssh/config:
1 | Host github.com |
- 加速 http 协议的 clone
1 | git config --global http.https://github.com.proxy http://127.0.0.1:7890 |
设置终端代理:
1 | export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 all_proxy=socks5://127.0.0.1:7890 |
官网安装脚本:https://brew.sh/index_zh-cn
ZSH
配置oh-my-zsh,参考:Mac 环境安装并配置终端神器 oh-my-zsh
zsh 插件安装:
.zshrc配置:
1 | plugins=(autojump sudo zsh-autosuggestions zsh-syntax-highlighting) |
- 安装
1 | # 请先挂代理: |
Nodejs
- 使用脚本安装 nvm: 链接
nvm install v12.x.x- 使用脚本安装 yarn: (因为 brew 安装方式的
--without-node选项已失效)
1 | curl -o- -L https://yarnpkg.com/install.sh | bash |
评论