Skip to content

Instantly share code, notes, and snippets.

@agirorn
Last active July 28, 2022 16:25
Show Gist options
  • Save agirorn/9c226a295f581ceab22e41afd5d5ee32 to your computer and use it in GitHub Desktop.
Save agirorn/9c226a295f581ceab22e41afd5d5ee32 to your computer and use it in GitHub Desktop.
Compleate node_modules reinstall for yarn workspaces
#!/usr/bin/env bash
# Steps:
# 1 Remove node_modules and yarn.lock from project root
# 2 Remove node_modules from all folders under packages
# 3 Install all the node_modules
rm -Rf node_modules yarn.lock \
&& find packages/ \
-name node_modules \
-maxdepth 2 \
-exec rm -rf '{}' \; \
&& yarn install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment