volta icon indicating copy to clipboard operation
volta copied to clipboard

Partial versions cause hard-to-read errors

Open gertsonderby opened this issue 2 years ago • 1 comments

Now I don't know if this is intentional, but incomplete version numbers cause the somewhat hard to understand error Volta error: Could not parse version "18".

I believe Volta ought to have the feature of simplified versions (i.e. major or major.minor only), but if not, I'd really like if the error message was more clear, perhaps clarifying that it needs an exact match.

gertsonderby avatar Jan 27 '23 08:01 gertsonderby

Hi @gertsonderby, thanks for reporting! Agreed that error message is really poor! I believe we have code elsewhere to show better errors in those cases, so we should be able to improve that in a fairly straightforward manner.

To the question about allowing fuzzy versions, that's actually an explicit choice that we've taken for Volta: One of our design goals is to allow repeatable builds that are fully-specified, so that they don't depend on e.g. which versions have been published since a project was pinned. Due to that, we require & write full versions into package.json for pinning the version.

charlespierce avatar Jan 30 '23 22:01 charlespierce