Skip to content

Installing deps with range ^ doesn't pick the latest available version #3873

@scinos

Description

@scinos

What version of Bun is running?

v0.6.15 (1790357)

What platform is your computer?

Darwin 21.6.0 arm64 arm

What steps can reproduce the bug?

Create a package with a package.json like:

{
  "name": "my-package",
  "dependencies": {
    "minimatch": "^3.0.4"
  }
}

Then run bun install

What is the expected behavior?

I'd expect to have minimatch@3.1.2 as a dependency, as it is the highest available version that matches the range ^3.0.4, as shown by npm info minimatch versions:

image

What do you see instead?

minimatch@3.0.8 is installed, as shown by bun pm ls --all:

image

Additional information

Checking the ranges and versions in https://semver.npmjs.com/ for minimatch and ^3.0.4, I saw 3.0.8 is listed after 3.1.2:

image

Looks like it was released later too:

image

No idea if this is related or is a red herring

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingbun installSomething that relates to the npm-compatible client

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions