# Search in the Spotlight index
# https://developer.apple.com/library/archive/documentation/Carbon/Conceptual/SpotlightQuery/Concepts/Introduction.html
mdfind "kMDItemFSName=node_modules && kMDItemContentType=public.folder" | xargs rm -rf
# Simple, fast and user-friendly alternative to find (brew install fd)
# https://github.com/sharkdp/fd
fd -t d -H -E node_modules | xargs rm -rf
# Search in Unix-like systems (works on macOS also!)
# https://man7.org/linux/man-pages/man1/find.1.html
find . -name "node_modules" -type d -prune -exec rm -rf '{}' +
or
find . -type d -name "node_modules" -delete
for /d /r . %d in (node_modules) do @if exist "%d" rd /s /q "%d"
fd -t d -H -E node_modules | xargs rm -rf
Please don't run this on your computer.....
WTF