Skip to content

Immediately use installed Node.js version #1369

@ghost

Description

Currently, when you run fnm use and the expected version is missing, fnm will ask you whether to install it. If you confirm that, fnm will install the new version but you will have to run fnm use again to actually use it:

$ node -v
v17.9.1
$ echo v17.0.1 > .node-version
$ fnm use
Can't find an installed Node version matching v17.0.1.
Do you want to install it? answer [y/N]: y
Installing Node v17.0.1 (x64)
00:00:04 ██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████ 21.16 MiB/21.16 MiB (4.72 MiB/s, 0s)
Enabling corepack for Node v17.0.1
$ node -v
v17.9.1
$ fnm use
Using Node v17.0.1
$ node -v
v17.0.1

This is very unexpected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions