mirror of
https://github.com/oven-sh/bun
synced 2026-02-09 18:38:55 +00:00
When `bun add pkg@version` is used to update a package that has an existing entry in the `overrides` (npm) or `resolutions` (yarn) section of package.json, the override/resolution entry was not being updated. This caused the old version from the override to be installed instead of the newly requested version. This fix adds an `editOverrides` function that updates any matching overrides/resolutions entries when a package is added or updated. The function is called twice: 1. Before install: Uses the literal version from CLI to ensure the install uses the correct version 2. After install: Uses the resolved version from the lockfile to ensure the final package.json has resolved versions (e.g., when using dist-tags like "latest") Fixes #25843 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>