Bun "error: Failed to install ... failed to resolve" in CI
Bun queried the registry and could not resolve a package version that satisfies your constraints. It reports "failed to resolve" for the offending dependency and aborts the install.
What this error means
bun install stops with "error: Failed to install" and a "failed to resolve <pkg>@<range>" line naming a version or range the registry does not offer.
bun install
error: failed to resolve "left-pad@^99.0.0" from package.json
error: Failed to install 1 packageCommon causes
The requested version range does not exist
The specifier in package.json points at a version no published release satisfies, so Bun has nothing to resolve.
The package is private or on another registry
A scoped or private package is not on the default registry, so Bun cannot find any matching version without the right registry configured.
How to fix it
Pin a version that is published
- Check the real published versions of the package.
- Correct the range in package.json to one that exists.
- Run
bun installand commit the updated lockfile.
bun install left-pad@^1.3.0Point the scope at the right registry
For private or scoped packages, configure the registry in bunfig.toml so Bun can resolve them.
[install.scopes]
"@acme" = { url = "https://npm.acme.internal/", token = "$NPM_TOKEN" }How to prevent it
- Use ranges that match published versions.
- Configure private registries and scopes in bunfig.toml.
- Commit bun.lockb so resolution runs once, not on every job.