Uninstalling Package by Binary Name
When running the list command, I get the following:
❯ volta list
⚡️ Currently active tools:
Node: v12.19.0 (default)
Yarn: v1.22.10 (default)
Tool binaries available:
firebase (default)
When trying to uninstall I get this:
❯ volta uninstall firebase --verbose
[verbose] Acquiring lock on Volta directory: /Users/christian/.volta/volta.lock
warning: No package 'firebase' found to uninstall
[verbose] Unlocking Volta Directory
[verbose] No custom hooks found
❯ which firebase
~/.volta/bin/firebase
Did I misunderstand the usage of volta somehow?
Hi @hffmnn, thanks for reporting! You didn't misunderstand the usage of Volta, we definitely should be cleaning up any binaries that match the name if there isn't a package. We'll investigate to see why it isn't doing that, as I know it used to, so it appears something regressed at some point.
@hffmnn, I took a deeper look at what we do, and I think I see the issue: We clean up packages based on the name, including any binaries that claim they were from that package (even if we don't find the package). In this case, the firebase binary was created by the package firebase-tools, which is what you would need to remove (e.g. volta uninstall firebase-tools).
There's definitely a gap there for situations like this where a tool is provided by a package with a different name (and where that package isn't installed).
I think this is something worth investigating, as there are a few outstanding questions around whether we should remove an entire package when volta uninstall <binary> is called, and how that interacts with related binaries (e.g. tsc and tsserver that are installed by the typescript package).
@charlespierce Thanks a lot for taking the deep dive and looking into it. Makes sense, that it currently does not work when running volta uninstall firebase now.
Maybe one solution could be to make the output of volta list more clear, like
Tool binaries available:
firebase (default) -> part of package firebase-tools
Packages:
firebase-tools
and rename uninstall to uninstallPackage. Or add a --binary flag to the uninstall command to remove the complete package + binary. Without the flag the command would behave as before, uninstalling the complete package.
Just an idea without thinking about all the implications like possible breaking changes and such.
I discovered the only way to see the package name is to use volta list all
Listing the package name upfront, or even a CLI note to use all to see the package name, would prevent this issue.