Skip to content

Instantly share code, notes, and snippets.

@farnetani
Forked from wgalleti/remove_all_nodemodules.md
Created August 29, 2019 00:12
Show Gist options
  • Save farnetani/fd5bbf7a7d941a6596658d47090499a0 to your computer and use it in GitHub Desktop.
Save farnetani/fd5bbf7a7d941a6596658d47090499a0 to your computer and use it in GitHub Desktop.

Remove all node_modules

choose the dir and run...

mac / linux

find . -name 'node_modules' -type d -prune -print -exec rm -rf '{}' \;

windows prompt

FOR /d /r . %d in (node_modules) DO @IF EXIST "%d" rm -rf "%d"

windows powershell

Get-ChildItem -Path "." -Include "node_modules" -Recurse -Directory | Remove-Item -Recurse -Force

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