【发布时间】:2019-01-08 15:41:33
【问题描述】:
我有多个使用 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"
但我不想搜索每个目录来查找 node_module 而是我想从我的 PC 中删除所有 node_module 文件夹(所有 驱动器)我该怎么做?
如果我需要返回 node_modules,我可以简单地运行 npm install,这样清理空间对我来说是个好主意。
【问题讨论】:
标签: node.js windows npm command node-modules