This guidance is from:
-
Clearing bundler caches on macOS and Linux - Expo Documentation
Clearing bundler caches on Windows - Expo Documentation
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. 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.
- Stop Expo CLI (
expo
), which should also stop the packager. Check your list of running processes to ensure these processes are not running. - Delete
node_modules
in your project
- If your project depends on other local projects (e.g. has a
file:
URI in its dependencies), clear those local project’snode_modules
directories too for good measure even though it’s probably unnecessary.
- Clear your Yarn or npm cache, depending on which you’re using, with
yarn cache clean
ornpm cache clean --force
- Run
yarn
ornpm install
to install your dependencies again - Run
watchman watch-del-all
to clear Watchman’s state - Kill the watchman daemon process
- Delete the Metro cache directory with
rm -fr $TMPDIR/metro-cache
- Delete the Haste map cache, which is used to track scanned files, with
rm $TMPDIR/haste-map-*
- Start Expo CLI with
expo start --clear
; the--clear
option instructs the bundlers (e.g., Webpack, Metro) to clear their caches
And just to be sure, force quit the Expo client on your phone or simulator and re-open it.