Open jenewland1999 opened 1 year ago
Are there any issues or PR's related to this? Scanning through the docs and other issues, I didn't find anything. I want to be able to put this on my automated installation process in my dotfiles. For that, I would like to install the lts version (which I know it's already possible) and use it automatically. That would be enough for me to change from nvm to fnm.
Are there any issues or PR's related to this? Scanning through the docs and other issues, I didn't find anything. I want to be able to put this on my automated installation process in my dotfiles. For that, I would like to install the lts version (which I know it's already possible) and use it automatically. That would be enough for me to change from nvm to fnm.
I did look through the issues prior to submitting this one and I didn't see anything that resembled this feature. If you wanted to automate the installation it does appear that if you simply install fnm and then do fnm install --lts
or fnm install --latest
provided you have a single version it will be set as the default.
Granted that's not really a great solution but it's a temporary work around. I'm sure there's other ways around it too using bash magic, though that's way beyond me 😅.
Would be neat if you could specify
lts
orlatest
for the use command either as an option (e.g.--lts
and--latest
) or as the version arg (e.g.lts
andlatest
)
Aliases would provide this functionality?:
lts-latest
is assigned with --lts
, and default
to the first node version installed (in addition to setting it as the default)lts-latest
, a latest
alias would be prone to drift over time where the version implied is inaccurate for fnm use
, so as an alias or version it may not be as useful?--lts
and --latest
options however differ and can resolve to whatever is relevant at the time queried. Using the options makes more sense due to that. UPDATE: fnm install --lts
will update the lts-latest
alias when appropriate, while a PR is open contributing the same feature for --latest
.
In my initial experience with fnm
(due to a bug mentioned below), I was also trying to figure out how to fnm use
(or similar commands) with a node version installed with --lts
or --latest
. If the options were supported, that'd work just as well.
If you wanted to automate the installation it does appear that if you simply install fnm and then do
fnm install --lts
orfnm install --latest
provided you have a single version it will be set as the default.
Presently there is a bug where this advice does not apply if you used fnm install
with --corepack-enabled
.
nvm uses node
in the nvmrc
file as an alias for latest. It would be nice to have interoperability.
What will be the meaning of --lts
considering there are 2 (soon 3) currently:
https://nodejs.org/en/about/previous-releases
--lts
means active LTS?
What will be the meaning of
--lts
considering there are 2 (soon 3) currently:
- 18 - Hydrogen
- 20 - Iron
- (22 - whatever name is chosen for it)
https://nodejs.org/en/about/previous-releases
--lts
means active LTS?
Good point, something I hadn't considered, though yeah I'd likely expect it to use the active LTS (the one that downloads by default on nodejs.org)
This could be considered a separate issue, or a part of this issue, but I'd like to request also supporting the value node
in .nvmrc for compatibility with nvm: https://github.com/nvm-sh/nvm?tab=readme-ov-file#nvmrc
This could be considered a separate issue, or a part of this issue, but I'd like to request also supporting the value
node
in .nvmrc for compatibility with nvm: https://github.com/nvm-sh/nvm?tab=readme-ov-file#nvmrc
Can't speak for the fnm project, but imho this would be a separate issue, if anything because it focuses on greater compatability with nvm and likely would involve changes different to that of what this issue is asking for. Great suggestion though! 🙂
Would be neat if you could specify
lts
orlatest
for the use command either as an option (e.g.--lts
and--latest
) or as the version arg (e.g.lts
andlatest
)Example using options
Example using args
Considerations
What happens if you don't have the version installed?
What happens when they're already using it