无法使用FNM安装和使用NodeJS

问题描述 投票:0回答:1

我使用以下命令在我的 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
)
node.js nodemanager
1个回答
0
投票

在安装 NodeJs 之前运行以下命令 -

fnm env --use-on-cd | Out-String | Invoke-Expression

我遇到了同样的错误,运行后能够安装节点。

图片

enter image description here

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.