Matched signals
- pnpm-lock.yaml
- yarn.lock
- package-lock.json
- lockfile mismatch
- lockfile integrity
- integrity mismatch
Package manager mismatch in lockfile
What this failure means
CI used one package manager (e.g., npm) but the repository has a lockfile from a different manager (e.g., pnpm or yarn), causing version and integrity mismatches.
Symptoms
Faultline looks for one or more of these log fragments:
pnpm-lock.yaml
yarn.lock
package-lock.json
lockfile mismatch
lockfile integrity
integrity mismatch
Diagnosis
The CI job is using a package manager that does not match the lockfile in the repository. Common scenarios:
- Repository has
pnpm-lock.yamlbut CI runsnpm installornpm ci. - Repository has
yarn.lockbut CI runsnpm installornpm ci. - CI was updated to use a new package manager but the workflow file was not updated.
- The wrong package manager is installed on the CI runner.
Symptoms include hash mismatches, integrity errors, or unexpected version conflicts.
Fix steps
-
Check which lockfile exists in the repository:
ls -la package-lock.json pnpm-lock.yaml yarn.lock 2>/dev/null -
Identify the intended package manager. Most projects include it in:
package.jsonunderengines.npm,engines.yarn, orengines.pnpm.npmrc,.yarnrc, or.pnpmrcfiles- CI workflow comments or documentation
-
Update the CI workflow to use the correct package manager and command:
- For npm:
npm ci - For yarn:
yarn install --frozen-lockfileoryarn ci - For pnpm:
pnpm install --frozen-lockfile
- For npm:
-
Ensure the correct package manager is installed on the runner. Refer to your CI platform’s documentation for switching package managers.
Validation
<package-manager> installcompletes without integrity or hash errors.ls -la package-lock.json pnpm-lock.yaml yarn.lockconfirms the expected lockfile matches the package manager.- Re-run the CI job.
Why it matters
Package managers produce different lockfile formats and apply different dependency resolution strategies. Mixing them leads to non-deterministic installs and hard-to-debug downstream failures.
Prevention
- Document the intended package manager in
package.jsonand CI workflow comments. - Add a CI step that checks for lockfile/package-manager consistency before installing.
- Use tooling like
~/.profilercor a.tool-versionsfile to enforce the package manager version globally.
Try it locally
ls -la package-lock.json yarn.lock pnpm-lock.yaml
npm install
npm ls
How Faultline detects it
Use faultline explain package-manager-mismatch to see the full playbook.
faultline analyze build.log
faultline explain package-manager-mismatch
Generated from playbooks/bundled/log/build/package-manager-mismatch.yaml. Do not edit directly.