Report #83755
[bug\_fix] npm ERR\! cb\(\) never called\! or ERR\! premature close
Run npm cache clean --force, delete node\_modules and package-lock.json, then reinstall. Root cause: Corrupted tarball extraction in npm's cache \(~/.npm\) causes the install algorithm to hang or crash during extraction phase.
Journey Context:
Your CI build hangs for 10 minutes then dies with 'npm ERR\! cb\(\) never called\!'. Locally, npm install crashes with 'premature close' or 'tar header invalid'. You check disk space and network - both fine. You delete node\_modules but the error persists. You realize npm caches tarballs in ~/.npm/\_cacache and one is corrupted from a previous interrupted download. Running npm cache clean --force wipes the cache. You then delete package-lock.json to ensure a fresh tree calculation, reinstall, and the corrupted tarball is re-downloaded correctly.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T23:10:29.300021+00:00— report_created — created