Skip to content
This repository has been archived by the owner on Aug 11, 2022. It is now read-only.

npm version does allow to set versions smaller than the current version #4087

Closed
seriousManual opened this issue Nov 4, 2013 · 5 comments
Closed

Comments

@seriousManual
Copy link

its easy to accidently write npm version 0.0.1 instead of npm version 1.0.1.
maybe outputting a warning to the user or demanding the usage of a force parameter to actually set a lower version would by sufficient.

seriousManual added a commit to seriousManual/npm that referenced this issue Nov 5, 2013
referencing npm#4087 if the version is smaller or equals
an error is thrown, can be overwritten be --force
@rlidwka
Copy link
Contributor

rlidwka commented Nov 5, 2013

It's a half measure, writing 10.0.1 instead of 1.0.1 is as undesirable as 0.0.1 really.

You should probably use npm version patch/minor/major instead.

@seriousManual
Copy link
Author

i agree.
but as long the specification of a certain version is possible why not doing a little sanity check?
a check for the same version is present so checking for a smaller version as well makes sense.

@luk-
Copy link
Contributor

luk- commented Nov 5, 2013

This really doesn't protect you from anything.

@timoxley
Copy link
Contributor

timoxley commented Jan 8, 2014

@zaphod1984 can you please close this in favour of your pull request?

FYI a handy way to convert an issue to a PR (at least on osx) is using hub

@seriousManual
Copy link
Author

will do, thanks for the heads up.

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

No branches or pull requests

4 participants