2

I've created the simple intitialised app via:

react-native init myApp

It creates it fine. And when I run it with:

react-native run-android

I get the following error:

Error: Unable to resolve module `./Libraries/YellowBox/YellowBox` from `node_modules\react-native\index.js`:

None of these files exist:
  * node_modules\react-native\Libraries\YellowBox\YellowBox(.native|.android.js|.native.js|.js|.and....(continues)

The incredibly frustrating thing about this is that I've successfully run the initialised app (on previous initialisations) multiple times in the last few days. So I don't know why it won't run today (tried three initialisations today). I haven't changed the code one character from the intitialisation. I've tried restarting my computer, deleting my virtual android device (via Android Studio) and creating a new one. Still the same error keeps coming up. I've tried running it via my physical Android device, same error. I've tried deleting the node-modules from the project and reinstalling them (npm install). Same error. Any ideas?

1
  • Commenting just to say that I am experiencing the same issue after re-installing dependencies - I'm using the out of the box typescript bare template from expo init. Commented Jul 26, 2020 at 14:56

2 Answers 2

3

I managed to solve it using this command:

react-native start --reset-cache

After start of the Metro run the app:

react-native run-android

In my case it happened after updating a package.

Sign up to request clarification or add additional context in comments.

Comments

1

Ran into this same issue, found it to be a caching issue with metro. YellowBox was moved to YellowBoxDeprecated.

I was able to fix this issue by doing the following:

  • delete node_modules and package-lock.json
  • clear metro-cache folder.(for windows default location is %appdata%\Local\Temp\metro-cache)
  • clear gradle cache (cd android & .\gradlew clean)
  • npm install the packages

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.