简体   繁体   English

React-Native停留在完成加载依赖关系图上。 没有错误

[英]React-Native stuck at Loading dependency graph done. No errors

I have a problem with my app, after running react-native run-android, the procees stop with blank page app at get stuck at loading dependency graph done... nothing happens. 我的应用程序出现问题,运行react-native run-android后,程序停止运行,并停留在空白页应用程序上,无法完成依赖关系图的加载...没有任何反应。 Everything was ok and suddenly not work anymore. 一切都很好,突然不工作了。

I tried everything i found on the internet... still not working. 我尝试了在互联网上找到的所有内容...仍然无法正常工作。 Any ideas? 有任何想法吗?

package.json This is what i get.. package.json 这就是我得到的..

Probably, it might be an issue with watchman. 也许,这可能是守望者的问题。 Please try to close all terminals and emulator, clean the project and give the build. 请尝试关闭所有终端和仿真器,清理项目并进行构建。 It did worked with me when i came across the same situation. 当我遇到相同的情况时,它确实对我有用。

When you're unable to load a bundle, look at the packager logs or the error message displayed in the Expo client to see if it's related to the packager. 当您无法加载捆绑软件时,请查看打包程序日志或Expo客户端中显示的错误消息,以查看它是否与打包程序有关。 If so, you should try clearing the packager's state to reduce the chance the bug is related to a stale cache or corrupt process. 如果是这样,则应尝试清除打包程序的状态,以减少该错误与过时的缓存或损坏的进程相关的机会。

These instructions are for macOS and Linux, but the general ideas apply to Windows as well. 这些说明适用于macOS和Linux,但一般思路也适用于Windows。

Stop XDE/exp, which should also stop the packager. 停止XDE / exp,这也应该停止打包程序。 Check your list of running processes to ensure these processes are not running. 检查您正在运行的进程的列表,以确保这些进程未运行。

  1. Delete node_modules in your project 删除项目中的node_modules
  2. If your project depends on other local projects (eg has a file: URI in its dependencies), clear those local project's node_modules directories too for good measure even though it's probably unnecessary. 如果您的项目依赖于其他本地项目(例如,具有文件:URI),则也请清除那些本地项目的node_modules目录,即使可能没有必要,也请这样做。
  3. Clear your Yarn or npm cache, depending on which you're using, with yarn cache clean or npm cache clean 清除纱线或npm缓存,具体取决于您使用的是,还是使用yarn cache clean或npm cache clean清除
  4. Run yarn or npm i to install your dependencies again 运行yarn或npm i再次安装您的依赖项
  5. Run watchman watch-del-all to clear Watchman's state 运行watchman watch-del-all以清除Watchman的状态
  6. Kill the watchman daemon process 杀死守卫守护进程
  7. Delete the packager's cache directory with rm -fr $TMPDIR/metro* 使用rm -fr $ TMPDIR / metro *删除打包程序的缓存目录
  8. Start XDE or exp 启动XDE或exp
  9. With exp, run exp r -c for good measure 使用exp可以运行exp r -c

And just to be sure, force quit the Expo client on your phone or simulator and re-open it. 并且可以肯定的是,强制退出手机或模拟器上的Expo客户端并重新打开它。

None of the above answers worked for me. 上面的答案对我都不起作用。 I had this issue after transferring my data from my old mac to my new one. 将数据从旧的Mac传输到新的Mac之后,出现了这个问题。 It turned out that the brew installed python was not properly transferred. 原来,未正确安装brew安装的python。 So, basically I uninstalled and reinstalled watchman. 因此,基本上我卸载并重新安装了watchman。

brew uninstall watchman python
brew install watchman

I then restarted the packager, and I was ready to go. 然后,我重新启动了打包程序,然后就可以开始了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM