查看自己有多少个node_modules
为了能够看看自己有多少个node_modules
可以首先进入有很多项目的目录
cd workplace
在linux中
find . -name "node_modules" -type d -prune | xargs du -chs
在windows中
FOR /d /r . %d in (node_modules) DO @IF EXIST "%d" echo %d"
删除目录中所有找到的node_modules
警告!这个步骤会删除所有名字为node_modules 的文件夹
进入目录
cd workplace
linux中删除
find . -name "node_modules" -type d -prune -exec rm -rf '{}' +
windows中
FOR /d /r . %d in (node_modules) DO @IF EXIST "%d" rm -rf "%d"
按以上步骤,我电脑弄出来将近20G的空间,没了累赘,项目移动起来也方便了!
