Scoop 包管理器安装教程

Windows 系统中安装 Scoop 包管理器,适合安装各种开发环境,以及版本管理。

步骤 1:启用 PowerShell 执行策略

在安装 Scoop 之前,您需要允许 PowerShell 执行本地脚本。

  1. PowerShell 执行以下命令:
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser

当提示时,输入 A 并按回车键确认。

步骤 2:安装 Scoop

现在您可以安装 Scoop 了。

  1. 在同一个 PowerShell 窗口中,执行以下命令:
irm get.scoop.sh | iex

这将下载并执行 Scoop 的安装脚本。

  1. 验证安装成功
scoop help

步骤 3:添加常用 bucket

为了能够安装更多软件,您可以添加一些常用的 bucket。

Scoop 常用 Bucket 列表

也就是Github仓库上的软件清单列表

更多包搜索:https://scoop.sh/

添加Github加速

scoop bucket add main https://gh-proxy.com/https://github.com/ScoopInstaller/Main.git

scoop bucket add versions https://gh-proxy.com/https://github.com/ScoopInstaller/Versions.git

scoop bucket add extras https://gh-proxy.com/https://github.com/ScoopInstaller/Extras.git

如果源已经存在则需要删除

scoop bucket rm main

查看所有bucket仓库

scoop bucket list

安装的软件存放目录

C:\Users\<你的用户名>\scoop\

常用命令示例

  1. 安装多个版本(示例)
scoop install nodejs   # 最新稳定版
scoop install nodejs20 # 20.x 版本
scoop install nodejs18 # 18.x 版本
  1. 查看已安装版本
scoop list nodejs*
  1. 使用 scoop reset 切换版本
scoop reset nodejs18

这条命令会把 node 命令指向 nodejs18 版本。

  1. 验证当前版本
node -v
❤️转载请注明出处❤️