-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bun install does not use specified version of a dependency even when it satisfies the sub-dependency requirements #6245
Comments
Workaround: I had to use yarn for the expo app package and it installed dependencies in the local node_modules which are used for it's tooling |
Notes - looking for bug:
pub fn orderWithoutTag(
lhs: Version,
rhs: Version,
) std.math.Order {
if (lhs.major < rhs.major) return .lt;
if (lhs.major > rhs.major) return .gt;
if (lhs.minor < rhs.minor) return .lt;
if (lhs.minor > rhs.minor) return .gt;
if (lhs.patch < rhs.patch) return .lt;
if (lhs.patch > rhs.patch) return .gt;
if (lhs.tag.hasPre()) {
if (!rhs.tag.hasPre()) return .lt;
} else {
if (rhs.tag.hasPre()) return .gt;
}
return .eq;
} Update: Actually, not sure if pre refers to the tag prefix or prerelease, but pre-release is really a part of patch, but maybe it was moved to the tag? Update 2: It does appear that hasPre is dealing with prerelease version, so it is correct for any prerelease to be before the version without prerelease: https://semver.org/#spec-item-9 |
It does not appear that Update: This is part of Query.token.tag Line 1775 in a6af1c8
|
In |
Note that resolveFromDiskCache is only used for auto-installs at runtime (not for |
I tried disabling global cache and removing the higher versions and that didn't change anything, so doesn't seem to be the source of the issue. |
Need to add a test:
I don't have this repo building on my system yet, so can't compile to check if this passes. The code appears correct, but need to add the test case anyway: |
Added my repo here: https://github.com/ricklove/ricklove-universal-app |
Reproduction in this PR on my repo: |
Ok, I added a minimal reproduction here: https://github.com/ricklove/bun-bugs
|
What you really want is #1134 |
@Jarred-Sumner in any other package manager, if you specify a version that satisfies the requirements, that will have priority when resolving sub dependencies (within the same workspace) |
Let me add npm, yarn, and pnpm results for comparison |
@Jarred-Sumner Looks like I am wrong. Looks like
|
Ok, I agree that #1134 would resolve this since my assumption does not seem to be in the specs for node module resolution. Also, using overrides is a much more clear indication of intention for a case like this (where a breaking change was introduced in a dependency) |
|
What version of Bun is running?
1.0.3+25e69c71e70ac8a0a88f9cf15b4057bd7b2a633a
What platform is your computer?
Linux 5.15.90.1-microsoft-standard-WSL2 x86_64 x86_64
What steps can reproduce the bug?
In my case, I was trying to use expo with expo router and nativewind.
postcss
introduced a breaking change in a minor version, so I needed to use specific versions of each:Minimal package.json:
What is the expected behavior?
Only version "8.4.21" should be used:
What do you see instead?
It's not using the specified version to satisfy the tilda version:
Additional information
Minimal reproduction repo: https://github.com/ricklove/bun-bugs
The text was updated successfully, but these errors were encountered: