Skip to content

Instantly share code, notes, and snippets.

@blurymind
Last active August 1, 2019 09:43
Show Gist options
  • Save blurymind/a529b2e10047252b4e67294084de9382 to your computer and use it in GitHub Desktop.
Save blurymind/a529b2e10047252b4e67294084de9382 to your computer and use it in GitHub Desktop.
windows batch script to recursively delete all node_modules folders within a project. Could help when storybook is acting funny
@ECHO OFF
:: This batch file deletes all node_modules subfolders.
TITLE Deleting node_modules folders...
ECHO Scanning, Please wait...
for /d /r . %%d in (node_modules) do @if exist "%%d" echo "%%d" && rd /s/q "%%d"
ECHO done!
PAUSE
@blurymind
Copy link
Author

...in case yarn lerna clean is not doing it well enough for you

@blurymind
Copy link
Author

linux users can
sudo find . -name "node_modules" -type d -exec rm -rf '{}' +

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment