-
-
Notifications
You must be signed in to change notification settings - Fork 747
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
Feature: "n upgrade" for upgrading major versions #568
Comments
Nice proposal: leading with the why, and multiple ideas for how. I was wondering why you would check for newer version separately since My first reaction is I prefer alternative 2 (prune per version as part of upgrade, keep it simple and target this workflow). Historical references: some aspects of this have come up before: #384 #452 Side note 1: this would be a bit easier to implement after a switch to using Side note 2: Not ready for a PR yet, but am interested in exploring idea and any feedback from readers. |
Similar prune idea mentioned in #404 |
There hasn't been any upvotes on this, but I would like this myself! Personally, more for the cleanup than the updates. If I switch to a different major version I often do it by number so get the newest version anyway. I have been wondering about syntax. I am now thinking it is probably cleaner to keep the behaviours separate and support more use cases.
Would
|
Just released support for deleting versions from the menu per #590. This may be convenient enough for tidying up old versions that changing prune is less compelling. See how it goes... |
This has not received any upvotes, and I think less relevant now with the ability to delete from the menu. I personally have not wished for a Feel free to open a new issue if it comes up again, with new information and renewed interest. Thank you for your contributions. |
One of the most common use cases for
n
is keeping multiple major Node versions (e.g. 8, 10, 12 — maintenance LTS, active LTS and latest) and switching between them. However, upgrading these versions is very inconvenient. Every time, you have to go through these steps:n --lts
,n --latest
andn ls
).n prune
isn't useful because it removes all but the active version.To make this easier and more in line with other tools like
brew upgrade
andrustup update
, here's a proposal:n upgrade
: Install the latest available version of each installed major version. E.g. given10.8.0
and12.3.1
installed, it would install10.15.0
and12.4.0
.n prune
so that it removes all old minor versions of installed major versions. E.g. if you have8.16.0
,10.15.0
and10.16.0
, it would remove10.15.0
(keeping the latest versions of8
and10
regardless of which one is active).Alternative 1: instead of changing
prune
behavior, introduceprune-minor
command with the proposed behavior.Alternative 2: prune old versions as a part of
n upgrade
process (simplest).@shadowspawn I could try taking a stab at a PR if the proposal is accepted.
The text was updated successfully, but these errors were encountered: