How do you fix "Unable to resolve module" in React Native?

← React Native answers

Metro could not find the file or package you imported. Install the dependency, correct the path, then restart Metro with --reset-cache.

  • Package missing: run npm install, and make sure the package is in package.json rather than only installed globally.
  • Wrong path or case: import paths are case-sensitive on CI and on Android even if your Mac is not.
  • Moved or renamed file: restart with a cleared cache, since Metro may still hold the old path.
  • Monorepo or symlinked package: Metro needs watchFolders and nodeModulesPaths in metro.config.js to look outside the app folder.
  • Native module: after installing a package with native code, rebuild the app; a JavaScript reload is not enough.
npm install
npx react-native start --reset-cache

Related questions

Start debugging smarter today

Try Bugsee for free — no commitments, no hidden fees.

Free sign upLive demoNo credit card required