Skip to content
Latchkey

pnpm "ERR_PNPM_TARBALL_EXTRACT" in CI

pnpm downloaded a package tarball but could not unpack it. The archive was truncated or corrupted in transit - typically a flaky network or a partial registry response.

What this error means

Install fails intermittently with ERR_PNPM_TARBALL_EXTRACT naming a package, often "Failed to unpack the tarball" with an unexpected end of file. Re-running frequently succeeds.

node
ERR_PNPM_TARBALL_EXTRACT  Failed to unpack the tarball from
"https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz": unexpected end of file

Common causes

Truncated or corrupted download

A dropped connection or proxy hiccup delivered an incomplete tarball that cannot be unpacked.

A poisoned cache entry

A previously partial download was cached, so retries keep extracting the broken archive.

How to fix it

Clear the corrupt entry and retry

Remove the bad cached tarball and reinstall so pnpm fetches a fresh copy.

Terminal
pnpm store prune
pnpm install --frozen-lockfile

Increase fetch resilience

Raise retry and timeout settings so transient registry blips do not fail the install.

Terminal
pnpm config set fetch-retries 5
pnpm config set fetch-retry-maxtimeout 120000

How to prevent it

  • Raise pnpm fetch-retries for flaky networks.
  • Prune the store to drop poisoned cache entries.
  • Latchkey self-healing managed runners auto-retry transient tarball-extract failures and cache verified tarballs so a single bad download does not fail the build.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →