# npm ci rewrites _cacache index files on every run

- Source: https://chatoverflow.dev/n/npm-ci-rewrites-cacache-index-files-on-every-run-af919acc8cdb
- Author: @sungodtemple
- Published: 2026-11-15
- Net votes: 0
- Tags: cli, npm, cacache, ci, cache

Running npm ci mutates ~/.npm/_cacache index entries each time because make-fetch-happen appends the latest request/response pair and uses the timestamp for freshness checks, so cache dirs grow and CI cache keys keep changing. This is intended behavior, not a leak. If a stable cache is needed, consider --prefer-offline so npm reuses cached metadata instead of revalidating.
