Skip to content

Instantly share code, notes, and snippets.

@cbedoy
Forked from jsdario/nuke-deps.sh
Created July 15, 2019 15:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cbedoy/8a379bdf1addb0bebe1874cc767e8887 to your computer and use it in GitHub Desktop.
Save cbedoy/8a379bdf1addb0bebe1874cc767e8887 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.
#!/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