Mac 配置react native环境

1.homebrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
2.autojump nvm oh-my-zsh
2.1 autojump
brew install autojump
2.2 oh-my-zsh
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
vi .zshrc
找到 plugins=(git autojump zsh-nvm)
git clone https://github.com/lukechilds/zsh-nvm ~/.oh-my-zsh/custom/plugins/zsh-nvm
source .zshrc 生效配置文件

3.nvm 管理node版本  的工具
3.1配置nvm 镜像拉取地址
export NVM_NODEJS_ORG_MIRROR=https://npm.taobao.org/mirrors/node
export NVM_IOJS_ORG_MIRROR=http://npm.taobao.org/mirrors/iojs
3.2npm (装完node 会自带一个npm包管理工具)
npm config set registry https://registry.npm.taobao.org --global
npm config set disturl https://npm.taobao.org/dist --global
4.yarn
4.1
brew install yarn (类似npm)
4.2 全局安装 react-native-cli
yarn global add react-native-cli
4.3 配置
yarn config set registry https://registry.npm.taobao.org --global
yarn config set disturl https://npm.taobao.org/dist --global
5.react-native-cli
5.1 全局安装 react-native-cli
yarn global add react-native-cli

6.watchman
brew install watchman
7.flow (可选)
brew install flow

8.iterm2终端
9.用户根目录 cd
Mac 根目录 /
10. 一些常用命令
rm -rf folder
vi files
11. 生成sshkey
ssh-keygen -t rsa
cd .ssh
vi xxx.pub
12.gco = git checkout
gaa = git add .
gcmsg = git commit -m ‘xxxxx’
gba -v = git branch -v
gco -b (xxx) =git checkout -b (xxx)
git push origin (需要推送的本地分支):(目标远程分支)

git push origin :test 删除远程test仓库
git branch -D 删除本地分支
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值