Skip to content

Instantly share code, notes, and snippets.

@nardan
Last active March 18, 2020 07:50
Show Gist options
  • Save nardan/af38db3e501022854a974cda57349b2f to your computer and use it in GitHub Desktop.
Save nardan/af38db3e501022854a974cda57349b2f to your computer and use it in GitHub Desktop.
Deleting Node Modules
Get-ChildItem -Path "." -Include "node_modules" -Recurse -Directory | Remove-Item -Recurse -Force
# FOR /d /r . %d in (node_modules) DO @IF EXIST "%d" echo %d"
# FOR /d /r . %d in (node_modules) DO @IF EXIST "%d" RMDIR /S /Q %d
FOR /d /r . %d in (node_modules) DO @IF EXIST "%d" echo %d && RMDIR /S /Q %d
#!/bin/bash
# find . -name "node_modules" -exec rm -rf '{}' +
find . -regextype posix-extended -regex "^.*(node_modules|package-lock.json|npm-shrinkwrap.json)$" -exec rm -rf '{}' +
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment