有没有办法删除所有 node_module 而无需从本地驱动器打开每个项目?
Is there a way to delete all node_module without opening the every single project from local drive?
我有多个使用 node_modules
的项目,我一个月都没有碰过。
如果我可以删除 node_module
,那可以节省我 5 到 8 GB 的存储空间。
我在 Windows 中找到了 递归删除具有指定名称的文件夹的命令行工具
但这显示删除特定文件夹中的文件,如
D:\Project\Doing\prject1\
D:\Project\Complete\Project1\
FOR /d /r . %d IN (project1) DO @IF EXIST "%d" rd /s /q "%d"
But i don't want to search every directory to look for node_module instead i want to delete all the node_module folder from my PC (all
the drive) how can i do that?
如果我需要 node_modules 回来,我可以简单地 运行 npm install
所以清除 space 对我来说是个好主意。
要列出所有 node_modules,请在命令舞会中使用此命令:
FOR /d /r . %d in (node_modules) DO @IF EXIST "%d" echo %d"
要删除你可以这样做:
FOR /d /r . %d in (node_modules) DO @IF EXIST "%d" rm -rf "%d"
这仅在 powershell cmd 中不起作用
我找到了非常有效的解决方案here。
find . -name "node_modules" -exec rm -rf '{}' +
我有多个使用 node_modules
的项目,我一个月都没有碰过。
如果我可以删除 node_module
,那可以节省我 5 到 8 GB 的存储空间。
我在 Windows 中找到了 递归删除具有指定名称的文件夹的命令行工具 但这显示删除特定文件夹中的文件,如
D:\Project\Doing\prject1\
D:\Project\Complete\Project1\
FOR /d /r . %d IN (project1) DO @IF EXIST "%d" rd /s /q "%d"
But i don't want to search every directory to look for node_module instead i want to delete all the node_module folder from my PC (all the drive) how can i do that?
如果我需要 node_modules 回来,我可以简单地 运行 npm install
所以清除 space 对我来说是个好主意。
要列出所有 node_modules,请在命令舞会中使用此命令:
FOR /d /r . %d in (node_modules) DO @IF EXIST "%d" echo %d"
要删除你可以这样做:
FOR /d /r . %d in (node_modules) DO @IF EXIST "%d" rm -rf "%d"
这仅在 powershell cmd 中不起作用
我找到了非常有效的解决方案here。
find . -name "node_modules" -exec rm -rf '{}' +