Created
August 14, 2019 07:14
-
-
Save rao123dk/22cc8d8474a568e9f0bd57a0794455db to your computer and use it in GitHub Desktop.
delete all node_modules in your system
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(A) This command will print out each folder, and even show us how much space the folder is occupying | |
// Mac / Linux: | |
find . -name "node_modules" -type d -prune -print | xargs du -chs | |
//Windows: | |
FOR /d /r . %d in (node_modules) DO @IF EXIST "%d" echo %d" | |
(B) Delete all node_modules found in a Directory: | |
NOTE :- ******* WARNING: This process is irreversible! ***** | |
// Mac / Linux: | |
find . -name 'node_modules' -type d -prune -print -exec rm -rf '{}' \; | |
//Windows: | |
FOR /d /r . %d in (node_modules) DO @IF EXIST "%d" rm -rf "%d" | |
//Powershell Users: | |
Get-ChildItem -Path "." -Include "node_modules" -Recurse -Directory | Remove-Item -Recurse -Force | |
Source :- https://dev.to/trilon/how-to-delete-all-nodemodules-folders-on-your-machine-43dh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment