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

Version-Numbers are sorted lexically? alpha9 ist "newer" than alpha31 #58

Closed
ottes opened this issue Mar 19, 2014 · 4 comments
Closed

Comments

@ottes
Copy link

ottes commented Mar 19, 2014

We saw this, when installing https://www.npmjs.org/package/zombie

Via Sinopia Version 2.0.0-alpha9 is installed, without it 2.0.0-alpha31 will be used.

I guess this is not the behaviour it should be, right?

@rlidwka
Copy link
Owner

rlidwka commented Mar 20, 2014

I guess this is not the behaviour it should be, right?

Bad guess. :)

It seems to be a correct behaviour.

version 2.0.0-alpha9 is installed, without it 2.0.0-alpha31 will be used.

Sinopia is using semver sort provided by semver package. But it's the same algorithm npm itself is using. For example, npm install 'zombie@<2.0.0-alpha10' will install 2.0.0-alpha1, not 2.0.0-alpha9 as you would expect.

Note that 2.0.0-alpha9 is considered greater than 2.0.0-alpha31, but 2.0.0-alpha.9 is lower than 2.0.0-alpha.31:

> require('semver').compare('2.0.0-alpha9', '2.0.0-alpha31')
1
> require('semver').compare('2.0.0-alpha.9', '2.0.0-alpha.31')
-1

So you might consider filing a bug report against zombie package asking to change their alpha numbering system.

@ottes
Copy link
Author

ottes commented Mar 20, 2014

I will do this.... but one question is open: why is it working with npm directly, but not with sinopia? is it possible to "stick" the version on sinopa site, not on my package.json ?

@rlidwka
Copy link
Owner

rlidwka commented Mar 22, 2014

why is it working with npm directly, but not with sinopia?

It works with npm because "latest" tag is set. Sinopia ignores this tag for a number of reasons, but it might be changed in the future.

@rlidwka
Copy link
Owner

rlidwka commented Apr 1, 2014

Starting from [email protected], behaviour of "latest" tag is consistent with npm registry. So, it should work now.

closing as duplicate of #50

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants