How do you clear the Metro bundler cache in React Native?

← React Native answers

Start Metro with npx react-native start --reset-cache. For Expo projects use npx expo start --clear.

npx react-native start --reset-cache   # bare React Native
npx expo start --clear                  # Expo
 
# If it still misbehaves
watchman watch-del-all
rm -rf node_modules && npm install
cd ios && pod install && cd ..

Reach for a cache reset when edits do not show up, when you renamed or moved files and Metro still looks for the old path, or after switching branches with different dependencies. For native build problems, also clean the platform build (Xcode's Clean Build Folder, or ./gradlew clean in the android folder).

Related questions

Start debugging smarter today

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

Free sign upLive demoNo credit card required