Last active
December 12, 2023 08:36
-
-
Save jsdario/5f4b0320d4cacb599553ed162563640a to your computer and use it in GitHub Desktop.
Script to clean watchman, remove node_modules, clean cache and restart packager for React Native troubleshooting.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Stop cached listeners | |
watchman watch-del-all | |
# Remove installed modules | |
rm -rf node_modules | |
# Remove yarn meta files | |
rm yarn* | |
# Install only fresh copies | |
yarn cache clean | |
yarn | |
# Kill any other instance of the packager | |
lsof -ti:8081 | xargs kill | |
# Restart the thing | |
npm start --reset-cache |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
rm yarn* - Also deletes yarn.lock. Not sure if that should be the case when troubleshooting.