Skip to content

Conversation

gribnoysup
Copy link
Collaborator

Le Roux ran into an interesting issue when trying to bump @leafygreen-ui/lib just one minor version up that was causing the update-dependencies script (or just a normal npm install) to fail on the last step with the following error:

npm error code EOVERRIDE
npm error Override for @leafygreen-ui/lib@15.3.0 conflicts with direct dependency

I traced it back to some slightly unexpected behavior in npm internals. Usually if you'd run npm install library@version, if version doesn't contain a range of any sort, npm will install specified version and add it to package.json with a caret: "library": "^version". Before it does that though, it runs a check against overrides field in package.json, and the version spec must match exactly what's in there for it to pass. In this case 15.3.0 that we are trying to install would not be equal to ^15.3.0 even if it's a matching range and will end up in the package.json in the same form and npm fails.

The fix is quite straightforward: just make sure that we consistently use caret range everywhere in the update script.

@gribnoysup gribnoysup requested a review from a team as a code owner September 12, 2025 15:09
@gribnoysup gribnoysup requested a review from nbbeeken September 12, 2025 15:09
@github-actions github-actions bot added the fix label Sep 12, 2025
@gribnoysup gribnoysup added the no release notes Fix or feature not for release notes label Sep 12, 2025
@lerouxb lerouxb added the no-title-validation Skips validation of PR titles (conventional commit adherence + JIRA ticket inclusion) label Sep 12, 2025
@gribnoysup gribnoysup merged commit a9644ab into main Sep 12, 2025
26 of 30 checks passed
@gribnoysup gribnoysup deleted the consistent-caret-for-update-script branch September 12, 2025 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix no release notes Fix or feature not for release notes no-title-validation Skips validation of PR titles (conventional commit adherence + JIRA ticket inclusion)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants