-
In GitBash shell, copy and paste the commeand below in the terminal under your destinated directory:
find . | grep /node_modules$ | grep -v /node_modules/ | xargs rm -fR
IMPORTANT: Make sure you're operating in the directory you want the
node_modulesto be deleted. If you you use this command in your root directory of your entire OS, it will delete ALLnode_modules.
find . | grep /package-lock.json$ | grep -v /package-lock.json/ | xargs rm -fRfind . | grep /dist$ | grep -v /dist/ | xargs rm -fRfind . \( -path '*/node_modules' -o -path '*/package-lock.json' -o -path '*/dist' \) -prune -exec rm -fR {} +