我使用以下命令在我的 Windows 10 笔记本电脑上安装了 FMM
winget install Schniz.fnm
安装后,我使用下载了NodeJS
fnm install 16.2.0
执行此步骤后,当我输入
fnm use 16.2.0
时,出现以下错误
error: We can't find the necessary environment variables to replace the Node version. You should setup your shell profile to evaluate
fnm 环境, see https://github.com/Schniz/fnm#shell-setup on how to do this Check out our documentation for more information: https://fnm.vercel.app
我在 power-shell 中尝试了以下命令。但这对我没有帮助:(
fnm env --use-on-cd | Out-String | Invoke-Expression
notepad $profile
@echo off
:: for /F will launch a new instance of cmd so we create a guard to prevent an infnite loop
if not defined FNM_AUTORUN_GUARD (
set "FNM_AUTORUN_GUARD=AutorunGuard"
FOR /f "tokens=*" %%z IN ('fnm env --use-on-cd') DO CALL %%z
)