volta-cli / volta

Volta: JS Toolchains as Code. ⚡
https://volta.sh
Other
10.96k stars 230 forks source link

Support `volta uninstall` for node and yarn #327

Open mikrostew opened 5 years ago

mikrostew commented 5 years ago

Similar to #319 - since we have volta install for Node and Yarn, we should also support volta uninstall.

chriskrycho commented 5 years ago

Per conversation in Discord today (see esp. 1, 2, 3, 4), this is probably worth designing and implementing alongside the logic for volta install npm. I've marked it for now as needs RFC accordingly.

BProg commented 4 years ago

In a little discord discussion around the possibility to uninstall yarn and node, a little idea came up:

I was thinking that maybe they will get deleted automatically after some time of not using them xD

maybe worth trying 🤷

dwiyatci commented 3 years ago

Hi all 👋

is there an alternative way to do this manually while waiting for the RFC to be done? For example, if I'm not using yarn@1.22.10 anymore and want to "uninstall" it, would it be enough to rm -rf the followings?

Thank you.

charlespierce commented 3 years ago

@dwiyatci Yep, that's exactly what you'd need to do to reclaim the space: The first directory is the unpacked install, while the 2nd is the cached tarball.

Possibly important caveat: After deleting, if you come across that version again in a project, it will be automatically re-downloaded (in the same way that they're automatically downloaded the first time they are seen).

migs35323 commented 2 years ago

Recently node upped from 18.0.0 to 18.1.0 and i just "updated" it so i have no great reason to keep the 8.flat version, so i was looking to unninstall it just to don't have a massive list of leftovers, maybe based on "volta uninstall" we can also get a "volta prune"? so it deletes the minor releases? should work with the tools and package managers as well examples: installed list:

hxii commented 2 years ago

I've made a small utility to remove unused Node versions from Volta: https://pypi.org/project/vnu/

dwiyatci commented 2 years ago

I've made a small utility to remove unused Node versions from Volta: https://pypi.org/project/vnu/

@hxii I love the "Disclaimer" section 😃

TheRealPSV commented 2 years ago

For any Windows users who end up here, the equivalent folder to ~/.volta/tools in Windows is %localappdata%\Volta\tools

You can delete the mentioned folders in the same way.

MrChocolatine commented 1 year ago

Friendly bump, after nearly 3 years. This would be a great addition.

NayamAmarshe commented 1 year ago

No solution yet? Unfortunately, I will have to move away from Volta because of this. I do not want yarn v4 installed by default and I do not want to pin files in someone else's project either.

charlespierce commented 1 year ago

Hi @NayamAmarshe, can you clarify the trouble you’re running into? Volta doesn’t install anything by default: It runs what it determines is the appropriate version of a tool. It figures that out by looking in 2 places: Pinned in the current project or explicitly selected as the global default by you.

Volta will only use Yarn 4 if you choose that version (either as your default or if a project chooses it). Currently, there is an issue where Yarn 4 is published as the latest version in the npm registry—see #1443—however you can always choose an explicit version when selecting your global default. For example, if you want to stick to using Yarn 1, you could run volta install yarn@1.

Lastly, the nature of Volta’s “fetch on-demand” model means that “uninstall” isn’t really the proper analogy for this command. It’s really closer to “cache clean” since the appropriate version will be redownloaded as necessary.

NayamAmarshe commented 1 year ago

For example, if you want to stick to using Yarn 1, you could run volta install yarn@1.

Thank you, it's actually my fault that I forgot I could do volta install yarn@1, yarn v4 created a lot of problems for me. I'd still however like to request support with the uninstall command because it's just one of those things that improve the UX for the user.

$ volta uninstall yarn
error: Uninstalling yarn is not supported yet.

I think behind the scenes you could do anything but showing "Uninstalling yarn is not supported yet" makes it seem like Volta has missing features and is incomplete. So, that's the only reason I'd like to request this.

Thank you

algoflows commented 1 year ago

So my yarn is stuck at 3.x now and I can't uninstall it and installing yarn1 doesn't downgrade it to yarn 1.... volta what a mess.

Konglomneshued commented 1 year ago

It's unacceptable that there is no way to uninstall, especially after three freaking years.

MrChocolatine commented 1 year ago

4 years+ , this issue was created on 27 March 2019.

Luckily there is a way to manually remove unwanted versions: https://github.com/volta-cli/volta/issues/327#issuecomment-920336408

ericp3reira commented 1 year ago

Hey people!

I was trying to remove yarn and still not able to do it through Volta, so I removed the folders as mentioned in https://github.com/volta-cli/volta/issues/327#issuecomment-920336408.

Since Volta was still referencing yarn from somewhere, on top of what @dwiyatci mentioned, I also:

ericp3reira commented 1 year ago

So my yarn is stuck at 3.x now and I can't uninstall it and installing yarn1 doesn't downgrade it to yarn 1.... volta what a mess.

@algoflows I was able to go back to v1 by removing all versions except the v1.22 (https://github.com/volta-cli/volta/issues/327#issuecomment-920336408) and volta install yarn@1 later

1111mp commented 1 year ago

Not being able to uninstall Node is really frustrating...but there is no doubt that Volta is still a very great project.

I wrote a Node version management tool myself: (nvm-desktop), but it is a desktop application with a visual interface. Similar to Volta, but it only provides a shim for the Node engine and does not affect the behavior of the Node engine(npm,yarn,pnpm...) itself at all.

The download, installation and management of Node are performed through the client interface, and command line tools are also provided to manage different versions.

image image

$ nvmd --help
nvmd (2.2.0)
The1111mp@outlook.com
command tools for nvm-desktop

Usage: nvmd [COMMAND]

Commands:
  current  Get the currently used version
  list     List the all installed versions of Node.js
  ls       List the all installed versions of Node.js
  use      Use the installed version of Node.js (default is global)
  which    Get the path to the executable to where Node.js was installed
  help     Print this message or the help of the given subcommand(s)

Options:
  -h, --help     Print help
  -V, --version  Print version

Please download new version of Node.js in nvm-desktop.

Hope it helps you.

(If this comment of mine makes you feel uncomfortable, please feel free to let me know and I will delete it promptly.)

TLovers commented 9 months ago

It's almost 2024

chriskrycho commented 9 months ago

It's true! And maybe in 2024 someone will fund the work to get this both designed and implemented; that would be awesome! 😅

morishin commented 8 months ago

Happy new year 2024! 🤚

I couldn't understand why this has not been implemented for so many years, so I created a simple implementation for discussion. I would like to know whether this approach is acceptable or if there are any concerns.

NayamAmarshe commented 8 months ago

Happy new year 2024! 🤚

I couldn't understand why this has not been implemented for so many years, so I created a simple implementation for discussion.

I would like to know whether this approach is acceptable or if there are any concerns.

  • 1658

Yay! Finally! I hope they merge this! It's been 5 years!

chriskrycho commented 8 months ago

Thank you! At a basic level, the only reason it has not been implemented is that we’re all super busy and none of our employers has had the need for it so it has not gotten our time and attention (as you can see from looking at our activity level, it is “squeeze in maintenance in spare time because we care” mode… like me doing a bunch of triage on a Saturday morning!). I will look at that POC either later today or sometime early next week, but I am EXCITED!!! about the prospect of it landing.

trry-hub commented 5 months ago
image

Do you have a solution now?

MrChocolatine commented 5 months ago

Do you have a solution now?

@trry-hub

https://github.com/volta-cli/volta/issues/327#issuecomment-920336408

trry-hub commented 5 months ago

Do you have a solution now?现在有解决办法了吗?

@trry-hub

#327 (comment)

This solution is too Muggle, I have already used NVM

MrChocolatine commented 5 months ago

@trry-hub

This solution is too Muggle, I have already used NVM

trry-hub commented 5 months ago

@trry-hub

This solution is too Muggle, I have already used NVM

  • Too Muggle?
  • You asked "Do you have a solution now?", I gave you a link to a solution to delete a version of Node.js. (since the CLI still does not include such feature, unfortunately)

PS: I did not write in Chinese in my original message.

I just don't think it's elegant enough. Thank you for your reply

TheJaredWilcurt commented 4 months ago

hope it's added soon.

mulder999 commented 2 months ago

I initially thought there was an issue with my Volta installation when I came across this thread. It seems that the volta uninstall command either should be removed if it's not implemented, or it should display a clearer message indicating that the command is not yet functional. The current error message, "No package node@22.3.0 found to uninstall," is completly misleading and should be revised.

chriskrycho commented 2 months ago

Yep, agreed. That message is fixed in the upcoming release! (When? Soon, hopefully!)