How to clear cache in a react-native project
April 07, 2021
How to clear cache in a react-native project
Clearing out cache is another way if your project is not working. React-native project throws unknown bugs sometimes and it gets automatically fixed if you clear the cache.
How to clear cache:
It is simple. But before that, remove the node_modules folder and install it again.
rm -rf node_modulesthen
npm i
or
yarn addthen start the server by restarting the cache:
npm start -- --reset-cacheor
yarn start --reset-cacheIf it doesn’t work,
reset watchman:
watchman watch-del-allreset cache for react-native (if react-native cli is installed):
react-native start --reset-cacheFor expo, use it:
expo start -c