fnm icon indicating copy to clipboard operation
fnm copied to clipboard

[Request] Add --install-if-missing to fnm exec ?

Open jcayzac opened this issue 3 years ago • 2 comments

I'm calling fnm directly and not using a shell environment. This means fnm use fails because it can't find the environment it depends on. I would love being able to pass --install-if-missing directly to fnm exec, e.g.

$ fnm exec --using="v10.24.1" --install-if-missing -- node --version
Installing Node v10.24.1 (x64)
v10.24.1
$ fnm exec --using="v10.24.1" --install-if-missing -- node --version
v10.24.1
$ fnm exec --using="v10.24.1" --install-if-missing -- node --version
v10.24.1

jcayzac avatar Aug 20 '21 06:08 jcayzac

I'd also love this for fnm env --use-on-cd.

Alternatively, supporting a ~/.fnmrc with default arguments would also go a long way with these workflow-specific requirements. (sorry if it's already a feature, I didn't see any mention of it in the docs)

rafasoares avatar May 11 '22 08:05 rafasoares

It's surprising that this isn't default behaviour.

As it is, cd-ing into a directory after .nvmrc has changed just errors out with "Requested version vx.x.x is not currently installed" and break stuff, making use-on-cd a lot less useful.

ricardobeat avatar Jan 24 '24 14:01 ricardobeat