Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support volta uninstall for node and yarn #327

Open
mikrostew opened this issue Mar 27, 2019 · 32 comments
Open

Support volta uninstall for node and yarn #327

mikrostew opened this issue Mar 27, 2019 · 32 comments

Comments

@mikrostew
Copy link
Contributor

mikrostew commented Mar 27, 2019

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

@chriskrycho
Copy link
Contributor

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
Copy link
Contributor

BProg commented Sep 4, 2020

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 🤷

@charlespierce charlespierce changed the title Support notion uninstall for node and yarn Support volta uninstall for node and yarn Sep 10, 2021
@dwiyatci
Copy link

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.

@charlespierce
Copy link
Contributor

@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
Copy link

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

@hxii
Copy link

hxii commented Jun 8, 2022

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

@dwiyatci
Copy link

dwiyatci commented Jun 8, 2022

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
Copy link

TheRealPSV commented Aug 10, 2022

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
Copy link
Contributor

MrChocolatine commented Nov 17, 2022

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

@NayamAmarshe
Copy link

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
Copy link
Contributor

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
Copy link

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
Copy link

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
Copy link

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

@MrChocolatine
Copy link
Contributor

MrChocolatine commented Jul 2, 2023

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

Luckily there is a way to manually remove unwanted versions:
#327 (comment)

@ericp3reira
Copy link

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 #327 (comment).

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
Copy link

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 (#327 (comment)) and volta install yarn@1 later

@1111mp
Copy link

1111mp commented Sep 26, 2023

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

@TLovers
Copy link

TLovers commented Dec 25, 2023

It's almost 2024

@chriskrycho
Copy link
Contributor

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

@morishin
Copy link

morishin commented Jan 20, 2024

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
Copy link

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.

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

@chriskrycho
Copy link
Contributor

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
Copy link

image

Do you have a solution now?

@MrChocolatine
Copy link
Contributor

Do you have a solution now?

@trry-hub

#327 (comment)

@trry-hub
Copy link

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

@trry-hub

#327 (comment)

This solution is too Muggle, I have already used NVM

@MrChocolatine
Copy link
Contributor

MrChocolatine commented Apr 23, 2024

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

@trry-hub
Copy link

@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
Copy link

hope it's added soon.

@mulder999
Copy link

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 [email protected] found to uninstall," is completly misleading and should be revised.

@chriskrycho
Copy link
Contributor

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

@ZinkWu
Copy link

ZinkWu commented Dec 2, 2024

Version 2.0.1 still does not support it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests