Skip to content
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 resolving to wrong major version of beta packages #5691

Closed
thecrypticace opened this issue Sep 18, 2023 · 5 comments · Fixed by #6312
Closed

bun install resolving to wrong major version of beta packages #5691

thecrypticace opened this issue Sep 18, 2023 · 5 comments · Fixed by #6312
Labels
bug Something isn't working npm Something that relates to the npm-compatible client

Comments

@thecrypticace
Copy link

thecrypticace commented Sep 18, 2023

What version of Bun is running?

1.0.2+37edd5a6e389265738e89265bcbdf2999cb81a49

What platform is your computer?

Darwin 22.6.0 arm64 arm

What steps can reproduce the bug?

The following package.json resolves to the wrong major version when installing via bun:

{
  "dependencies": {
    "@babel/types": "^7.0.0-beta.54"
  }
}

After installation it'll install 8.0.0-alpha.2 rather than 7.22.19. This also applies to any dependents because it's using 8.x to resolve dependencies.

Quick repro:

git clone https://github.com/thecrypticace/bun-install-issue
cd bun-install-issue
yarn install && grep 'version' yarn.lock
bun install --yarn && grep 'version' yarn.lock

What is the expected behavior?

I would expect bun to resolve the version(s) to 7.22.19 (or at least any 7.x version) rather than 8.x.

What do you see instead?

It resolves the package and its dependents to 8.x versions.

Additional information

I (manually) cleared the bun install cache and did installs using --force as well and the problem persisted so it doesn't appear that this is cache related.

@thecrypticace thecrypticace added the bug Something isn't working label Sep 18, 2023
@Electroid Electroid added the npm Something that relates to the npm-compatible client label Sep 18, 2023
@spiritledsoftware
Copy link

I'm also experiencing this

@mmacoveiciuc
Copy link

Same happening on Bun 1.0.4 for me with various packages, including packages from our private NPM repo. Installing a package pinned to a specific version and it fetches something from 2 years ago.

Any ideas?

@Jarred-Sumner
Copy link
Collaborator

@dylan-conway is working on this

@thecrypticace
Copy link
Author

thecrypticace commented Oct 5, 2023

@Jarred-Sumner @dylan-conway I just built bun from source and it looks like this is still a problem — even in the test repo I provided above.

I suspect it's more related to this area of the semver handling which are currently commented out as I believe these aren't handled correctly yet:

bun/src/install/semver.zig

Lines 2277 to 2279 in 4a2e157

// "1.0.0-rc.1",
// "1.0.0-rc.2",
// "1.0.0-rc.3",

@thecrypticace
Copy link
Author

Fixed as of v1.0.6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working npm Something that relates to the npm-compatible client
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants