我有多个使用 node_modules
的项目,我一个月都没有碰过。
如果我只能删除 node_module
可以节省我的 5 到 8 GB 存储空间。
我找到了 Command line tool to delete folder with a specified name recursively in 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
,所以清理空间对我来说是个好主意。
最佳答案
我找到了解决方案 here这就像一个魅力。
找到 . -name "node_modules"-exec rm -rf '{}' +
关于node.js - 有没有办法在不从本地驱动器打开每个项目的情况下删除所有 node_module?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51626997/