Does npm allow you to publish earlier versions of a package? The only documentation I could find was on npm’s site:
[npm-publish] Fails if the package name and version combination already exists in the specified registry.
Once a package is published with a given name and version, that specific name and version combination can never be used again…
So by these specs, could I theoretically publish
v3.2.0-beta before publishing
v3.1.0, as long as none of those name–version combinations already exist? (I assume the answer is “yes,” but you never know if the author left out what they considered obvious: that version numbers should only increase.)
This is the reason I ask. My current latest version is
v3.1.0-beta, and I’ve been doing work on my development branch ever since that release. But now I’m at a point where v3.2 is feature-locked, that is, no new features are to be added. So I feel like it’s time to go ahead and publish
v3.2.0-beta and start testing for bugs. However,
v3.1.0 (stable) hasn’t been published yet, and I don’t want to wait until that release to publish my beta of v3.2.
So essentially, am I free to publish
v3.2.0-beta now, even though v3.1 is still in beta, and then next week, would I still be able to publish
v3.1.0 even though it is has a lower version number? Or will npm report an error if I attempt to do so?
Can you point to any examples of packages that have done this? And which version does the
latest tag point to: the most recent, or the most precedent (having the highest precedence)?