npm Cache
npm keeps a local content-addressable cache of downloaded package tarballs, packuments, integrity metadata, and temporary extraction data so installs can reuse previously fetched content instead of hitting the registry every time. Over time, interrupted downloads, stale metadata, and leftover tarballs can accumulate under the npm cache directories and lead to integrity mismatches, repeated retries, or unexpectedly large disk usage. Kudu removes npm’s cached package data and metadata from the current and legacy cache locations while leaving your projects, node_modules folders, lockfiles, accounts, and npm configuration untouched.
Why clean npm Cache?
- A partially downloaded or corrupted tarball in _cacache triggers EINTEGRITY or unexpected end of JSON/input errors during npm install, which shows up as installs failing on packages that should normally fetch cleanly
- Stale packument metadata can make npm keep requesting versions or dist-tags that no longer match the registry, leading to confusing ETARGET or no matching version found errors until fresh metadata is fetched
- After interrupted installs or network timeouts, npm may keep retrying bad cached responses, so you see repeated fetch warnings, long install times, and the same package failing again
- The cache stores tarballs and index entries by content hash and can grow into multiple gigabytes, causing low disk space warnings even though your actual project folders are much smaller
- On Windows, older npm versions may have used a legacy %AppData% cache while newer runs use %LocalAppData%, leaving duplicate cached archives behind and making disk use seem inexplicably high
- Cache verification can pass while the underlying store is still bloated and fragmented with unneeded old entries, so clearing it is often the fastest way to resolve persistent install anomalies and reclaim space
- When a package manager workflow depends on fresh downloads after registry changes, stale cached artifacts can mask the update, and you notice npm reusing old package contents until the cache is cleared
Cache paths Kudu targets
Windows
%LocalAppData%/npm-cache |
%AppData%/npm-cache |
macOS
~/.npm/_cacache |
Linux
~/.npm/_cacache |
Common questions about npm Cache
Download Kudu and reclaim your disk space.
Available on Windows, macOS, and Linux. No account required, no feature gates, no telemetry without consent. All cleaning targets are open source and community-auditable.