react native 升級后 運行不起來

高高興興升級了RN,卻發(fā)現(xiàn)運行不起來

確認(rèn)build文件配置

第一步:

image.png

第二步:


image.png

第三步:


image.png

確認(rèn)node,npm,watchman最新

node,npm

# 先安裝模塊n
npm install n -g
# 將 node 升級到最新穩(wěn)定版
n stable

# 將 npm 升級到最新版
npm install npm -g
# 如果要指定版本,可以通過@指定版本
# npm install npm@3.10.10 -g 

#watchman
npm r -g watchman
brew install watchman

現(xiàn)在出現(xiàn)運行一下就好了,不用改代碼真好

可能遇到對錯誤

Error: fsevents unavailable (this watcher can only be used on Darwin)

react native環(huán)境跑不起來,終端報

Error: `fsevents` unavailable (this watcher can only be used on Darwin)

后面查找到原因watchman版本過舊或者錯誤,重新安裝了watchman

npm r -g watchman
brew install watchman

如果你不幸運,遇到權(quán)限問題導(dǎo)致安裝無法成功,可以嘗試卸載后重裝

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

xcode-select 安裝失敗

不要慌,百度一下發(fā)現(xiàn)解決方法全是執(zhí)行如下指令:

xcode-select --install

但是有時執(zhí)行該指令時會遇到如下問題:

不能安裝該軟件,因為當(dāng)前無法從軟件更新服務(wù)器獲得。

這個時候也不要慌,直接去developer.apple.com下載就好了。
進去選擇自己版本相應(yīng)的Command Line Tools,下載安裝就ok了。


image.png

小禮物走一走,來簡書關(guān)注我

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容