npm ERR! The `npm ci` command can only install with an existing package-lock.json or npm-shrinkwrap.json
npm ci needs a committed lockfile and didn’t find one.
Seen on:
npm
Meaning
Lockfile not committed (gitignored), or the project uses yarn/pnpm lockfiles instead.
Common causes
- package-lock.json in .gitignore
- Project uses yarn.lock or pnpm-lock.yaml
⚡ Quick fix
- Generate and commit package-lock.json
- Use the project’s package manager in CI (yarn install --frozen-lockfile, pnpm install --frozen-lockfile)
Detailed fix by platform
npm
npm install --package-lock-only && git add package-lock.json
How to diagnose
- Files — Which lockfile exists?
- Recent change — Did it start after a deploy, upgrade, or configuration change? Compare with the last working version.
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
Was this page helpful?
Report a correction or suggest an improvement
Last updated 2 Oct 2026