Windows 开发环境磁盘清理记录 - Higurashi

📅 2026/7/11 0:44:41 👁️ 阅读次数 📝 编程学习
Windows 开发环境磁盘清理记录 - Higurashi

这次主要清理开发工具缓存。能重建的直接删,不能删但会长期占空间的,就先复制到D盘,然后改所需的配置到新路径,再删老路径。

复制文件推荐使用 FastCopy。删除大文件夹推荐使用 CMD 命令rmdir /s /q folder

  1. uv

    查看缓存目录:

    uv cache dir
    

    清理缓存:

    uv cache clean
    

    如需迁移缓存目录,可设置:

    setx UV_CACHE_DIR D:\software\uv\cache
    
  2. Gradle

    .gradle缓存迁到别的盘,设置:

    setx GRADLE_USER_HOME D:\software\Gradle
    
  3. Yarn

    修改缓存目录:

    yarn config set cache-folder "D:\software\Yarn\Cache"
    
  4. Maven

    把本地仓库从${user.home}\.m2\repository改到D:\maven\repository。在%USERPROFILE%\.m2\settings.xml中加入:

    <localRepository>D:\maven\repository</localRepository>
    

参考:

  1. https://stackoverflow.com/questions/186737/whats-the-fastest-way-to-delete-a-large-folder-in-windows

  2. https://blog.csdn.net/github_38616039/article/details/79933133

  3. https://blog.csdn.net/zimeng303/article/details/109741322

  4. https://www.cnblogs.com/technicist/p/15060205.html