Other Commands

This page includes cleaning and reinstalling the prebuild, android, ios and node_modules folders.

1

Prebuild - Continuous Native Generation (Create android & ios files)

npx expo prebuild
// or
npx expo prebuild --platform ios
// or
npx expo prebuild --platform android
2

Clean & Fresh Rebuild

# watchman
# Delete all active watchman watches (file system watcher for React Native)
watchman watch-del-all
# Delete temporary React Native/Metro bundler cache folders
rm -rf $TMPDIR/react-native-packager-cache-*
rm -rf $TMPDIR/metro-cache

# node modules
# Delete the node_modules folder
rm -rf node_modules && package-lock.json
# Clean the npm cache (use 'yarn cache clean' if using Yarn)
npm cache clean --force
# Reinstall all project dependencies
npm install

# Navigate into the Android native directory
cd android && ./gradlew clean && cd ..

# Navigate into the iOS native directory
cd ios && pod cache clean --all && rm -rf Pods/ && rm -rf Podfile.lock && pod install && cd ..

Last updated