Skip to content

"*" is satisfied by versions with a pre-release #123

Closed

Description

@adamreeve

In the range tests there's this test:

['*', 'v1.2.3-foo', true]

Which indicates that the version 1.2.3-foo will satisfy the range *. But this behaviour goes against what is described in the README, which says that:

If a version has a prerelease tag (for example, 1.2.3-alpha.3) then it will only be allowed to satisfy comparator sets if at least one comparator with the same [major, minor, patch] tuple also has a prerelease tag.

I can't find anywhere that states that X-ranges allow pre-release versions. I would expect that 1.2.3-foo would not satisfy *, but if this is the expected behaviour, then it should be documented.

Also, if * is satisfied by 1.2.3-foo, then why is 1.* not satisfied by 1.2.3-foo? This behaviour seems inconsistent.

Activity

  1. changed the title [-]"*" is satisfied by vesions with a pre-release[/-] [+]"*" is satisfied by versions with a pre-release[/+] on Apr 6, 2015
  2. isaacs commented on Apr 8, 2015

    @isaacs
    Contributor

    Indeed, this is a bug. Patch welcome (including patch that is just a failing test, since that'll irk me until the tests pass again ;)

  3. qzb commented on Apr 8, 2015

    @qzb

    I agree that this behaviour is inconsistent so should be changed, but on the other hand it's very useful. There are some projects maintained by people who doesn't understand how semver works. These projects have prerelease tags in their stable release versions (e.g. node-zookeeper). This behaviour could be used to workaround this issue.

  4. added a commit that references this issue on Apr 12, 2015
    7d3c7e4
  5. benjamn commented on Jun 23, 2015

    @benjamn

    This turned out to be a breaking change for the read-installed package, which npm uses: npm/read-installed#40

    I think the problem can be fixed on their end, but I thought I would surface it here, in case anyone here thinks this issue can be addressed more conservatively.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions