you can
cd
into where most of your projects are.
$ cd project
$ find . -name "node_modules" -type d -prune -print | xargs du -chs
...
$ find . -name "node_modules" -type d -prune -print | xargs du -chs
251M ./jaedsadadotme/jaedsadadotme-blog/node_modules
102M ./jaedsadadotme/jaedsada.me/node_modules
353M total
$ FOR /d /r . %d in (node_modules) DO @IF EXIST "%d" echo %d"
$ cd project
$ find . -name 'node_modules' -type d -prune -print -exec rm -rf '{}' \;
$ cd project
$ FOR /d /r . %d in (node_modules) DO @IF EXIST "%d" rm -rf "%d"
Ref :
How to delete ALL node_modules folders on your machine and free up HD space!