You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
"*" is satisfied by versions with a pre-release #123
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.
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.
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.
Activity
[-]"*" is satisfied by vesions with a pre-release[/-][+]"*" is satisfied by versions with a pre-release[/+]isaacs commentedon Apr 8, 2015
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 ;)
qzb commentedon Apr 8, 2015
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.
Fix for range "*" with a prerelease version
benjamn commentedon Jun 23, 2015
This turned out to be a breaking change for the
read-installedpackage, whichnpmuses: npm/read-installed#40I 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.