fnm icon indicating copy to clipboard operation
fnm copied to clipboard

manually set a node install directory location

Open FrederickEngelhardt opened this issue 3 years ago • 6 comments

Hi,

Is there a way to configure the location of fnm's installation of node?

This use case is related to developer tooling exclusions for microsoft defender. Having the option to specify a path would allow for the node install to be automatically added to our exclusion list.

FrederickEngelhardt avatar Feb 05 '22 00:02 FrederickEngelhardt

Yes! All the installations and data is stored in the directory $FNM_DIR env var is pointing to. An easy way to set it can be done by adding a --fnm-dir="..." to the fnm env call.

Schniz avatar Feb 05 '22 07:02 Schniz

@Schniz Hi, I've set $FNM_DIR but the installs still takes place in the default directory from fnm env

$env:FNM_MULTISHELL_PATH = "C:\Users\i_am_\AppData\Local\fnm_multishells\18836_1645547820612"
$env:FNM_VERSION_FILE_STRATEGY = "local"
$env:FNM_DIR = "D:\Code\System\fnm"
$env:FNM_LOGLEVEL = "info"
$env:FNM_NODE_DIST_MIRROR = "https://nodejs.org/dist"
$env:FNM_ARCH = "x64"

I would have presumed FNM_MULTISHELL_PATH would have pointed to a directory relative to FNM_DIR.

anantoghosh avatar Feb 22 '22 16:02 anantoghosh

It is not, as the multishell is an ephemeral resource (a shell session-specific symlink)

Schniz avatar Feb 22 '22 16:02 Schniz

ah ok, thank you. My D: drive is a different disk. Is there a way to modify the default root for FNM_MULTISHELL_PATH? I would have preferred if every file was kept on the same drive.

anantoghosh avatar Feb 22 '22 16:02 anantoghosh

There's no way to provide that. But we might have a way in the near future.

Schniz avatar Mar 06 '22 10:03 Schniz