Skip to content

Expo and React Native errorExpo and React Native: “Unable to resolve module”

The app fails to start, or an EAS build fails, with Unable to resolve module followed by a package name or a file path. Metro, the bundler, looked for the import and didn’t find it. In apps built with AI tools the import is often a package the tool used but never installed, or a path alias the project doesn’t define. Here are the usual causes, in Expo’s words, or hand it over at a fixed price.

Short answer

If the name is a package, install it with npx expo install package-name and commit package.json and the lockfile. If it starts with @/ or ~/, add the alias to tsconfig.json and restart Expo CLI. If it is a file path, check the folder and the exact upper and lower case of the file name. If none of those, clear the caches and start again with npx expo start --clear.

Read the module name, then pick the fix

  1. 01

    Metro is the one looking

    “Read on if you're writing a custom resolver, debugging an "Unable to resolve module" error, or working out why Metro picked a particular file.” Metro, Resolution

    The error comes from Metro’s resolver: it tried node_modules, your aliases and the relative path, and found nothing. The module name in the message tells you which of the fixes below applies, and the from path tells you which file has the import.

  2. 02

    A package that isn’t installed

    “Install and update packages that work with the version of react-native in your project” Expo, Expo CLI

    An AI tool or a copied snippet imports a package that was never added to package.json, or it was installed on one machine and never committed. Install it with Expo’s command, which picks a version that matches your SDK, and commit package.json with the lockfile so EAS and teammates get it too.

    npx expo install react-native-svg
    git add package.json package-lock.json
  3. 03

    A path alias the project doesn’t define

    “Restart Expo CLI after modifying tsconfig.json to update path aliases.” Expo, Using TypeScript: path aliases

    Imports like @/components/Button only work when tsconfig.json maps @/* to a folder. Add the mapping, then stop and restart the dev server: a running one doesn’t pick up the change.

    {
      "extends": "expo/tsconfig.base",
      "compilerOptions": {
        "baseUrl": ".",
        "paths": {
          "@/*": ["src/*"]
        }
      }
    }
  4. 04

    A file name that differs in case

    import Button from './components/button' finds Button.tsx on a Mac, where file names ignore case by default, and fails on a Linux build machine, where they don’t. If it works locally and fails on EAS or in CI, compare the import with the file name letter by letter, and rename with git mv so git records the change.

  5. 05

    A stale cache after moving files or switching branches

    “Clearing a cache sometimes can help you work around issues related to stale or corrupt data and is often useful when troubleshooting and debugging.” Expo, Clear bundler caches on macOS and Linux

    If the file and package are where the import says, try npx expo start --clear first. If that doesn’t help, run the full reset. These are the npm steps from Expo’s troubleshooting page for macOS and Linux; Windows has its own page:

    rm -rf node_modules
    npm cache clean --force
    npm install
    watchman watch-del-all
    rm -fr $TMPDIR/haste-map-*
    rm -rf $TMPDIR/metro-cache
    npx expo start --clear

Checked against the vendor’s docs on : Metro docs: Resolution; Expo docs: Expo CLI (npx expo install); Expo docs: Using TypeScript (path aliases); Expo docs: Clear bundler caches on macOS and Linux.

Rather hand it over?

Fixed scope, fixed price, paid upfront. The work happens in writing; no call needed.

Related: Expo EAS build failed · React Native “Unable to load script” · React Native “Text strings must be rendered within a <Text> component” · Expo Go project incompatible

Questions

More on this error

Why does it work on my machine but fail on EAS?

Two usual reasons: a package installed locally but missing from the committed package.json or lockfile, or an import whose case differs from the file name, which a Mac forgives and a Linux build machine doesn’t.

The module is a Node built-in like fs or crypto. What now?

React Native doesn’t include Node’s built-in modules. Replace the package that needs them with one written for React Native, or move that work to your server or an Edge Function.

Can you fix it for me?

If one bug is the whole problem, the App Fix Ticket covers it: a written diagnosis first, then the fix. If the app has more going on, the Launch Check is a written check of the whole app. Each issue found is rated critical, high, medium or low, with where it is and how it was confirmed. No issues worth fixing, no charge. If the Launch Check finds nothing rated medium or higher, Simon refunds the full $450. You keep the report either way. This applies to the first 10 Launch Checks bought after October 30, 2026.

A different error?

Describe it and get a written quote

Send the error and what you were doing. You get a written scope, a fixed price and a timeline; Simon replies by email, usually within one business day.