Ziqi (Katrina) Ding

Back

The Problem#

When we change the library version, it’s easy to have some issues that are because the caches contains old version code, causing a pods/embedding issue.

The Solution#

Do the clean install

How to Do It#

From repo root:

watchman watch-del-all || true

rm -rf $TMPDIR/metro-* $TMPDIR/haste-map-*

rm -rf node_modules

yarn install

cd ios

# or remove all derived data: ~/Library/Developer/Xcode/DerivedData/*
rm -rf Pods Podfile.lock  ~/Library/Developer/Xcode/DerivedData/<project_name>-*

pod cache clean --all

pod install
bash

On your test device or emulator, delete the app (or Device -> Erase All Content and Settings…)

Quit and reopen Xcode, clean build folder (Product -> Clean Build Folder…).

Start metro and build the app again

watchman watch-del-all && yarn cache clean && yarn start --reset-cache --verbose
bash

Summary#

A full clean reinstall — clearing Watchman, Metro cache, node_modules, Pods, and DerivedData — resolves most stale-cache build issues after changing library versions in React Native.

Clean and Reinstall RN dependencies
https://katrina-ziqi-ding.com/blog/clean-and-reinstall-rn-dependencies
Author Ziqi (Katrina) Ding
Published at 01-09-2025
Comment seems to stuck. Try to refresh?✨