React Native 环境搭建
1,安装 HomeBrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
2, 安装 nvm
brew install nvm
安装以后可能会提示
按照上面的提示,终端执行以下代码:
mkdir ~/.nvm
vi ~/.zshrc
进入 ~/.zshrc 以后执行在末尾插入
export NVM_DIR="$HOME/.nvm" . "/usr/local/opt/nvm/nvm.sh"
3,安装 node.js
nvm install node && nvm alias default node
4, 安装 watchman
brew install watchman
5, 安装 flow
brew install flow
如果之前通过 brew安装 node, 卸载 node
brew remove --force node
sudo rm -r /usr/local/lib/node_modules
brew prune
sudo rm -r /usr/local/include/node
# 检查brew是否正常
brew doctor