fnm icon indicating copy to clipboard operation
fnm copied to clipboard

Is it possible to provide a command like 'npm config set' to permanently modify the node installation path of fnm

Open curlykay opened this issue 1 year ago • 2 comments

I'm using fnm on windows powershell I've checked all the fnm documentation and issues, but can't find a way to permanently modify $FNM_DIR. Now I am adding the following code to the environment file $PROFILE in powershell to permanently modify the node installation path (in powershell only).

$env:FNM_DIR="D:\applications\fnm-windows\nodejs\"
fnm env --use-on-cd | Out-String | Invoke-Expression

Maybe I'm missing something, is there an official fnm method like 'fnm env set' to permanently modify these env var? If not, will it be available in the future?

curlykay avatar Mar 12 '23 06:03 curlykay

additionally, you need to set Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned. 😫

thelostword avatar Jul 15 '23 06:07 thelostword

I dont believe its possible for a process to permanently modify the env vars of its parent process. Any changes made within the process will be lost once the app finishes running. iirc theres the setx or set command for windows but none for linux/mac or other platforms. At most what fnm could do is edit the .bashrc or ps profile files itself to persist changes, thats the same as what you can do by hand.

Yakiyo avatar Aug 17 '23 15:08 Yakiyo