Safety
Is it safe to delete the npm cache?
Yes. The cache is a download accelerator, not your app. Clearing it is one of the safest reclaim moves on a full SSD.
Manual clear
npm cache verify npm cache clean --force # typical location # macOS/Linux: ~/.npm # Windows: %LocalAppData%\npm-cache
What it does not do
- It does not remove
node_modulesinside projects. - It does not uninstall global packages.
- It does not fix wrong versions in package.json.
Other package caches on the same disk
npm is rarely alone. Each of these is a download cache its tool rebuilds:
~/.cache/pipand condapkgsfor Python~/.pub-cache(Windows:%LOCALAPPDATA%\Pub\Cache) for Dart and Flutter- Go build and Deno caches, Gradle, NuGet and CocoaPods
~/.cache/pre-commithook environments
Docker build cache
If you build images, Docker keeps every layer it ever built. This clears the build cache and untagged images while keeping your tagged images, containers and volumes:
docker system df docker builder prune docker image prune
On Windows the freed space stays inside Docker’s virtual disk until that disk is compacted.
FAQ
Is it safe to delete the npm cache?
Yes. npm cache clean --force removes cached tarballs. The next install re-downloads packages. It does not delete your project node_modules.
Will this fix a broken install?
Sometimes. Clearing the cache helps corrupt tarball cases. For dependency issues, delete node_modules and lockfile carefully in the project instead.