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

Listing installed node versions #103

Closed
RobbieTheWagner opened this issue Feb 24, 2020 · 7 comments
Closed

Listing installed node versions #103

RobbieTheWagner opened this issue Feb 24, 2020 · 7 comments

Comments

@RobbieTheWagner
Copy link

Is there a way to list node versions? In normal nvm nvm ls typically lists the installed node versions and you are able to find and delete ones you no longer want. Is there an equivalent here?

@JGJP
Copy link

JGJP commented Apr 23, 2020

I too would like to have the ability to just see installed versions when using nvm ls. I don't need to see every single version of node that's available.

@jorgebucaran
Copy link
Owner

This works:

ls ~/.config/nvm| awk /[0-9]/

We could also define $nvm_config in advance inside our configuration snippet (that runs when your shell starts) allowing:

ls $config_nvm | awk /[0-9]/

...which you may consider a slight improvement.


Why isn't there a formal way to do this with fish-nvm out of the box?

Because fish-nvm doesn't have this notion of "installed" & "installable" versions. I just don't care what versions I've already downloaded. And that's why there's no nvm install or nvm add, but just nvm use. Downloading a new version doesn't usually take more than a few seconds, and once it's downloaded it goes straight into the cache. That's also why nvm ls lists you everything you can use (switch to)—whether that requires a new download or not is not important.

I prefer the simple approach taken here, but I understand that there are cons to this approach, e.g., not everyone has a consistently fast internet connection.

Does that make sense to you @rwwagner90 @JGJP?

@JGJP
Copy link

JGJP commented Apr 23, 2020

To me it feels like trying to reinvent something that's already established, I think I'm probably not the only one that came from regular nvm and had to change my mode of thinking. The regular expressions are quite tedious to type and I can't filter the results by LTS. Maybe you can create a flag that gives this full output? Across all CLIs ls commands usually default to what's on your system.

@jorgebucaran
Copy link
Owner

jorgebucaran commented Apr 23, 2020

To me it feels like trying to reinvent something that's already established

And what's wrong with that? I built this for fun, and because I couldn't be bothered to learn the original nvm completely, so it shouldn't come as a surprise that nvm and fish-nvm work differently. I didn't intend feature parity and I still don't.

Maybe you can create a flag that gives this full output? Across all CLIs ls commands usually default to what's on your system.

That wouldn't be hard to do, but it would be inconsistent with the project. fish-nvm doesn't have this notion of "installed" vs "installable" versions. nvm ls simply lists all the node versions you can use/switch to. Yes, we'll have to download any version that is not already in the cache, but that's just an implementation detail.

Having said that, consider creating a fish abbreviation.

The regular expressions are quite tedious to type and I can't filter the results by LTS

There isn't currently a way to filter the results to LTS releases only, but you can filter some of the output. Now, may I ask why you want to list the available LTS versions when you can just nvm use lts to get the latest LTS release?

@JGJP
Copy link

JGJP commented Apr 24, 2020

Now, may I ask why you want to list the available LTS versions when you can just nvm use lts to get the latest LTS release?

Your docs show that there is an lts for each named version of Node, some projects won't build on the current lts, and just picking a version number to install feels arbitrary.

I'm ok with just accessing the regular nvm via another means that is not fish-nvm because it's your prerogative to do what you want with your package, but I didn't make this issue, you should probably expect to hear similar questions in the future because the naming of your project and the "close but not quite" syntax is somewhat uncomfortable.

@ljharb
Copy link

ljharb commented Apr 24, 2020

There’s 5 LTS streams currently, and a 6th comes out in October; “LTS” isn’t a single thing.

@jorgebucaran jorgebucaran pinned this issue Apr 24, 2020
Repository owner locked as too heated and limited conversation to collaborators Apr 24, 2020
@jorgebucaran jorgebucaran unpinned this issue Dec 6, 2020
@jorgebucaran
Copy link
Owner

I just released 2.0. Now there are nvm list and nvm list-remote commands that print the locally installed Node versions and versions available to download respectively. Both commands accept a regular expression to filter the output too.

See the README for documentation. 👋

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

No branches or pull requests

4 participants