安装 Xcode
新电脑,直接App store安装,最新版xcode
由于电脑版本比较老旧,我们只能安装旧版的Xcode12.4
安装 Homebrew
// 命令粘贴至终端 [图1]
/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"
// 重启终端 或者 运行下面命令 [图2]
source /Users/zhangchengcai/.zprofile
// ## 确认知否安装成功 [图3]
brew --version
安装 Node & Watchman
我们推荐使用Homebrew来安装 Node 和 Watchman
brew install node // 但是运行报错了
brew install watchman
安装 Python。新M2电脑可跳过这一步
Python 官网(www.python.org/)
a.启动终端terminal
b.进入当前用户的home目录: 输入 cd ~
c.创建.bash_profile: 输入 touch .bash_profile
d.编辑.bash_profile文件: 输入 open -e .bash_profile
e.粘贴: PATH=/usr/local/Cellar/python/3.11.2/bin:${PATH} export PATH
node -v // v18.15.0
python3 -V // 3.11.2
安装 yarn
brew uninstall --force python
brew install --build-from-source python@3.11
安装mvn 切换node版本
# 国内安装mvn:
curl -o- https://gitee.com/mirrors/nvm/raw/v0.39.0/install.sh | bash
# 查看本机安装所有的node版本
nvm list
# 安装 node指定版本
nvm install 14.21.3
# 安装 node切换版本
nvm use 14.21.3