Environment On Mac
1.根據 RN官網 來安裝React Native的環境
2.安裝完react native後 .bashrc的設定
開啟terminal
$ cd ~
$ ls -a (此時可看見.bashrc等檔案)
$vi .bashrc
3.看該目錄下有無 .bash_profile 若沒有則新增
在該檔案內輸
if [ -f ~/.bashrc ]; then . ~/.bashrc; fi
確定.bashrc 和 .bash_profile 兩個檔案都有
4.確認變量都有寫入
$ source .bash_profile
$ export
如下圖,內有ANDROID_HOME等剛剛設定的變量
查看rn版本 (terminal路徑在rn project下)
$ react-native -v
參考
Last updated