volta icon indicating copy to clipboard operation
volta copied to clipboard

Support `volta uninstall` for node and yarn

Open mikrostew opened this issue 5 years ago • 29 comments

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

mikrostew avatar Mar 27 '19 22:03 mikrostew

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.

chriskrycho avatar May 09 '19 19:05 chriskrycho

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 🤷

BProg avatar Sep 04 '20 20:09 BProg

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 [email protected] anymore and want to "uninstall" it, would it be enough to rm -rf the followings?

  • ~/.volta/tools/image/yarn/1.22.10
  • ~/.volta/tools/inventory/yarn/yarn-v1.22.10.tar.gz

Thank you.

dwiyatci avatar Sep 15 '21 20:09 dwiyatci

@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).

charlespierce avatar Sep 15 '21 20:09 charlespierce

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:

  • node 18.1.0
  • node 18.0
  • node 16.15.1
  • node 16.14.2
  • node 16.14.1
  • node 16.12.0
  • node 12.8
  • node 12.5 $ volta prune node@16 -y
  • node 18.1.0
  • node 18.0
  • node 16.15.1
  • node 12.8
  • node 12.5 $ volta prune node -y
  • node 18.1.0
  • node 16.15.1
  • node 12.8

migs35323 avatar May 05 '22 10:05 migs35323

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

hxii avatar Jun 08 '22 16:06 hxii

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

@hxii I love the "Disclaimer" section 😃

dwiyatci avatar Jun 08 '22 17:06 dwiyatci

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.

TheRealPSV avatar Aug 10 '22 03:08 TheRealPSV

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

MrChocolatine avatar Nov 17 '22 16:11 MrChocolatine

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.

NayamAmarshe avatar Feb 08 '23 11:02 NayamAmarshe

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.

charlespierce avatar Feb 08 '23 17:02 charlespierce

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

NayamAmarshe avatar Feb 09 '23 00:02 NayamAmarshe

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 avatar May 03 '23 22:05 algoflows

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

Konglomneshued avatar Jul 02 '23 19:07 Konglomneshued

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

MrChocolatine avatar Jul 02 '23 20:07 MrChocolatine

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:

  • removed the yarn version from ~/.volta/tools/user/platform.json
  • deleted the symbolic link from ~/.volta/bin (mine was yarn -> ~/.volta/bin/volta-shim)

ericp3reira avatar Aug 17 '23 16:08 ericp3reira

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

ericp3reira avatar Aug 17 '23 16:08 ericp3reira

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)
[email protected]
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.)

1111mp avatar Sep 26 '23 08:09 1111mp

It's almost 2024

TLovers avatar Dec 25 '23 01:12 TLovers

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

chriskrycho avatar Jan 01 '24 01:01 chriskrycho

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

morishin avatar Jan 20 '24 07:01 morishin

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!

NayamAmarshe avatar Jan 20 '24 08:01 NayamAmarshe

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.

chriskrycho avatar Jan 20 '24 16:01 chriskrycho

image

Do you have a solution now?

trry-hub avatar Apr 22 '24 06:04 trry-hub

Do you have a solution now?

@trry-hub

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

MrChocolatine avatar Apr 22 '24 13:04 MrChocolatine

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

@trry-hub

#327 (comment)

This solution is too Muggle, I have already used NVM

trry-hub avatar Apr 23 '24 03:04 trry-hub

@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.

MrChocolatine avatar Apr 23 '24 13:04 MrChocolatine

@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

trry-hub avatar Apr 23 '24 13:04 trry-hub