Edit this page
Learn how to clear the bundler cache when using Yarn or npm with Expo CLI or React Native CLI on Windows.
Edit this page
Need to clear development caches on macOS or Linux? Find the relevant commands here.
There are a number of different caches associated with your project that can prevent your project from running as intended. Clearing a cache sometimes can help you work around issues related to stale or corrupt data and is often useful when troubleshooting and debugging.
# With Yarn workspaces, you may need to delete node_modules in each workspace
-
rm -rf node_modules
-
yarn cache clean
-
yarn
-
watchman watch-del-all
-
del %localappdata%Temphaste-map-*
-
del %localappdata%Tempmetro-cache
-
npx expo start --clear
-
rm -rf node_modules
-
npm cache clean --force
-
npm install
-
watchman watch-del-all
-
del %localappdata%Temphaste-map-*
-
del %localappdata%Tempmetro-cache
-
npx expo start --clear
# With Yarn workspaces, you may need to delete node_modules in each workspace
-
rm -rf node_modules
-
yarn cache clean
-
yarn
-
watchman watch-del-all
-
del %localappdata%Temphaste-map-*
-
del %localappdata%Tempmetro-cache
-
yarn start -- --reset-cache
-
rm -rf node_modules
-
npm cache clean --force
-
npm install
-
watchman watch-del-all
-
del %localappdata%Temphaste-map-*
-
del %localappdata%Tempmetro-cache
-
npm start -- --reset-cache
It is a good habit to understand commands you find on the internet before you run them. We explain each command below for Expo CLI, npm, and Yarn, but the corresponding commands React Native CLI have the same behavior.
Command | Description |
---|---|
del node_modules | Clear all of the dependencies of your project |
yarn cache clean | Clear the global Yarn cache |
npm cache clean --force | Clear the global npm cache |
yarn /npm install | Reinstall all dependencies |
watchman watch-del-all | Reset the watchman file watcher |
del %localappdata%\Temp/<cache> | Clear the given packager/bundler cache file or directory |
npx expo start --clear | Restart the development server and clear the JavaScript transformation caches |