https://www.mulianju.com/delete-all-node_modules/

查询当前目录下所有的node_modules目录和所占空间

Linux中的命令:

1
2
find . -name "node_modules" -type d -prune | xargs du -chs

Windows中的CMD命令:

1
FOR /d /r . %d in (node_modules) DO @IF EXIST "%d" echo %d"

删除当前目录下所有的node_modules目录

删除命令和查询命令差不多

Linux中的命令:

1
2
find . -name "node_modules" -type d -prune -exec rm -rf '{}' +

Windows中的CMD命令:

1
FOR /d /r . %d in (node_modules) DO @IF EXIST "%d" rd /s /q "%d"