title: ReactNative 啟動卡死在‘Loading dependency graph, done.’撬码, ‘info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.’
tag:
- js
- react-native
- bug
最近在學習rn儿倒,各種坑,各種莫名其妙的報錯,就比如今天夫否,只想裝一下
react-navigation
之后項目就跑不動了彻犁,執(zhí)行npm run start
卡死在Loading dependency graph, done.
,執(zhí)行npm run android
卡死在info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
凰慈,搜了一堆解決方法無果之后汞幢,意外的發(fā)現(xiàn)了一個方法
問題
正常啟動項目操作執(zhí)行命令npm run android
,發(fā)現(xiàn)卡死在了info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier
微谓,不會像以前那樣刷刷的給我跳森篷。
執(zhí)行 npm run start
或者 react-native start
的時候卡死在了Loading dependency graph, done.
,搜了一堆博客豺型,說這個時候就應(yīng)該是停在這疾宏,因為他沒有鏈接到任何可以鏈接的設(shè)備也就是說沒有找到模擬器〈ゴ矗可是模擬器確實是開著的。
打開瀏覽器輸入http://localhost:8081/index.bundle
为牍,這個時候會出來一段話哼绑,說什么什么沒找到,好像是一個node_module模塊沒找到碉咆,這個時候打開剛剛運行npm run start
的命令行抖韩,發(fā)現(xiàn),react-native
給了我們一個解決方法疫铜,一共四步茂浮。
解決方法
- 執(zhí)行
watchman watch-del-all
- 執(zhí)行
rm node_modules
刪掉依賴 - 重新裝依賴,注意不要用
npm
壳咕,一定要用yarn install
- 執(zhí)行
rm /tmp/metro-*
- 執(zhí)行
npm run android
完美解決席揽。