window安装 ¶
参考 ¶
https://blog.csdn.net/qq_51532249/article/details/144399700
https://blog.csdn.net/m0_59806124/article/details/143698798
通过 Chocolatey 安装 ¶
sh
# 打开 PowerShell
# 1、安装 Chocolatey(如果尚未安装): 在 PowerShell(管理员权限)中运行:
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
# 2、安装 fnm: 在 PowerShell 中运行以下命令:
choco install fnm
# 3、验证安装
fnm --version
安装流程 ¶
sh
# 打开 PowerShell
# 检测
fnm env
# 编辑
notepad $PROFILE
# 把以下内容保存
$fnmEnv = fnm env | Out-String
Invoke-Expression $fnmEnv
# 重新加载配置文件:
. $PROFILE
# 验证修复
fnm --version
node --version
npm --version