Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Better error messages for unsupported
uninstall
arguments
Instead of parsing whatever string the user supplied as the tool name and supplying a default `VersionSpec`, attempt to parse the value as a full specifier which may include a version. This means we can provide better errors when the user passes a version. Specifically we can report that Volta does not yet support uninstalling specific versions of tools. Previously, we would report something like this: ``` warning: No package 'typescript@5.4' found to uninstall ``` Notice that the old message treated `'typescript@5.4'` as the name of the tool, when it should have been treating it as a tool and a version specifier. Now, we instead report that uninstalling specific versions of tools is unsupported. The original motivation here was noticing that we printed errors like that if the user tried to uninstall a runtime or a package manager with a version specifier. This fixes that as well, since it no longer parses a string like `node@20.14.5` as a package, but rather as a runtime and version specifier, and can fall into the normal handling for runtimes.
- Loading branch information