Home About Me

Scoop and Version Managers: A Saner Windows Development Setup

Managing a development environment is its own skill. If you have ever typed node and gotten this back, you know the feeling:

$ node
node: The term 'node' is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

PowerShell error saying node is not recognized

Frustrating, right? This kind of failure usually comes from a messy PATH: the binary was never added, or the entry is malformed. People call it a polluted development environment. The usual advice is to reinstall the app, or even the OS. That rarely fixes the root cause, and eventually you give up on tweaking anything.

Reinstalling is not the only fix, and usually not the best one. The durable answer is a package manager: apt or yum on Linux, Brew on macOS, Chocolatey or WinGet on Windows—and, here, Scoop.

Why Scoop?

Windows already has Chocolatey and WinGet. Chocolatey is the veteran; WinGet is Microsoft’s own. The comparison below is admittedly biased:

<table> <thead> <tr> <th></th> <th>Winget</th> <th>Chocolatey</th> <th>Scoop</th> </tr> </thead> <tbody> <tr> <td>Centralized?</td> <td>Yes (Microsoft Store)</td> <td>Yes</td> <td>No</td> </tr> <tr> <td>Paid features?</td> <td>No</td> <td>Yes</td> <td>No</td> </tr> <tr> <td>Package count (as of 2022/12/19)</td> <td>3966 (from winget search "" and counting lines)</td> <td>9521</td> <td>37793 (official + third-party sources; duplicates possible)</td> </tr> <tr> <td>Publishing method</td> <td>Write a manifest and submit manually</td> <td>Write a manifest and submit manually</td> <td>Write a manifest and fetch from a bucket; no manual submission</td> </tr> <tr> <td>Updating your own package</td> <td>Manual</td> <td>GitHub Actions auto-update</td> <td>GitHub Actions auto-update</td> </tr> <tr> <td>Custom install scripts?</td> <td>Yes</td> <td>Yes</td> <td>Yes</td> </tr> </tbody> </table>

Scoop is fully open source, publishing a package is simple (add a JSON file and submit it on GitHub), and it is the most extensible of the three—hooks such as post_install can run scripts before or after installation. That is why Scoop is a reasonable pick over Chocolatey and WinGet.

Installation

Time to install. The official command is below; don’t run it just yet.

> Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
> irm get.scoop.sh | iex

One caveat: the install script pulls Scoop’s latest source from GitHub, so if GitHub is blocked or slow where you are, you may need a workaround.

Fast and convenient, yes. But if your C: drive is tight, don’t use that one-liner: the default install location is on C:. To choose your own directories:

> irm get.scoop.sh -outfile 'install.ps1'
> .\install.ps1 -ScoopDir 'D:/.scoop' -ScoopGlobalDir 'D:/.scoop-global'

ScoopDir and ScoopGlobalDir can be any two different directories. When the script finishes, run scoop in a terminal:

Scoop help output in a terminal

If you see that, it worked. Before installing software, learn two basic concepts.

Manifests and buckets

Scoop gets package information from manifests and buckets. A bucket is a collection of manifests; a manifest contains a package’s metadata—URL, name, version, description, and so on. By default Scoop pulls the official Main bucket to your machine, which contains many open-source tools. You can add other buckets later. When you run scoop install foo, Scoop searches these buckets for a matching manifest, gets the download link, and installs the package.

Usage

Node

Let’s build a Node environment with the version manager fnm. Why not n, nvm, or nvs? fnm does fuzzy matching—pass a major version and it installs—and it is a young, active project.

> scoop install fnm

Installing 'fnm' (1.31.1) [64bit] from main bucket
fnm-x86_64-pc-windows-msvc.zip (4.5 MB) [==================================================================] 100%
Checking hash of fnm-x86_64-pc-windows-msvc.zip ... ok.
Extracting fnm-x86_64-pc-windows-msvc.zip ... done.
Linking D:.scoop\apps\fnm\current => D:.scoop\apps\fnm\1.31.1
Creating shim for 'fnm'.
'fnm' (1.31.1) was installed successfully!

> fnm install --lts # Install the LTS version of Node
Installing Node v18.12.1 (x64)

> fnm default 18 # Use the latest version

Installing is not enough. Open PowerShell and run:

> notepad $PROFILE

In the Notepad window, add:

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

Now the Node environment is ready.

Rust

Rust is similarly short:

> scoop install rustup-msvc

Go

No ceremony:

> scoop install go

Other tools

Sometimes the tool you want isn’t in Main. Run scoop install osulazer and you’ll get Couldn't find manifest for 'osulazer'. Search for it:

Search results showing osulazer in the games bucket

osulazer lives in the Games bucket. Run:

> scoop bucket add games
> scoop install osulazer

The two commands in the search result are, in order, add the bucket and install the package. Run the first, then the second.

Fonts

Scoop can even install fonts. They live in the nerd-fonts bucket:

> scoop bucket add nerd-fonts

Install fonts globally, e.g. scoop install FiraCode-NF -g.

Tools I use

Finally, here are the buckets and packages I use:

>  scoop bucket list

Name       Source                                             Updated             Manifests
----       ------                                             -------             ---------
destiny    https://github.com/so1ve/destiny.git               2022/12/14 4:29:35          6
dorado     https://github.com/chawyehsu/dorado.git            2022/12/19 8:11:45        227
extras     https://github.com/ScoopInstaller/Extras           2022/12/19 16:27:47      1752
games      https://github.com/Calinou/scoop-games             2022/12/19 16:28:28       247
java       https://github.com/ScoopInstaller/Java             2022/12/17 16:18:12       253
main       https://github.com/ScoopInstaller/Main             2022/12/19 16:28:35      1129
nerd-fonts https://github.com/matthewjberger/scoop-nerd-fonts 2022/12/14 5:12:47        209
siku       https://github.com/amorphobia/siku.git             2022/12/17 0:39:11         57
versions   https://github.com/ScoopInstaller/Versions         2022/12/19 16:35:38       400

> scoop list

Installed apps:

Name               Version          Source     Updated             Info
----               -------          ------     -------             ----
7zip               22.01            main       2022-11-05 12:02:09
adb                33.0.3           main       2022-11-05 12:02:11
ag                 2.2.5            main       2022-11-05 12:02:16
aria2              1.36.0-1         main       2022-11-05 12:13:39
bat                0.22.1           main       2022-11-05 12:13:41
bazel              5.3.2            main       2022-11-05 12:17:02
bottom             0.6.8            main       2022-11-05 12:17:12
broot              1.16.2           main       2022-11-05 12:19:34
busybox            4784-g5507c8744  main       2022-11-14 10:04:28
cheat              4.4.0            main       2022-11-14 10:04:41
clink              1.4.0            main       2022-11-14 10:04:43
cloc               1.94             main       2022-11-05 12:22:03
cloudflared        2022.10.3        main       2022-11-05 12:41:57
cmake              3.24.3           main       2022-11-05 12:49:00
curlie             1.6.9            main       2022-11-05 12:49:38
dark               3.11.2           main       2022-11-05 12:53:24
delta              0.14.0           main       2022-11-05 12:53:27
deta               1.3.3-beta       main       2022-11-05 13:06:14
docker             20.10.21         main       2022-11-05 13:06:28
docker-compose     2.12.2           main       2022-11-05 13:12:24
dockercompletion   1.2010.1.211002  extras     2022-11-05 13:06:32
duf                0.8.1            main       2022-11-05 13:12:40
dust               0.8.3            main       2022-11-05 13:12:58
dvm                1.8.6            destiny    2022-11-05 12:53:39
fd                 8.5.2            main       2022-11-05 13:13:10
ffmpeg             5.1.2            main       2022-11-05 13:55:42
FiraCode-NF        2.2.2            nerd-fonts 2022-11-05 13:59:22
fnm                1.31.1           main       2022-11-05 14:00:09
fzf                0.35.0           main       2022-11-14 10:04:45
gh                 2.20.0           main       2022-11-14 10:04:49
gitui              0.21.0           main       2022-11-15 21:05:10
go                 1.19.3           main       2022-11-05 14:03:45
gow                0.8.0            main       2022-11-05 14:08:06
gpg                2.3.8            main       2022-11-05 14:10:58
gping              1.4.0            main       2022-11-05 14:11:04
gradle             7.5.1            main       2022-11-05 14:14:25
gsudo              2.0.2            main       2022-11-14 10:05:01
helix              22.08.1          main       2022-11-05 14:18:02
hexyl              0.10.0           main       2022-11-05 14:18:10
hub                2.14.2           main       2022-11-05 14:19:08
hugo-extended      0.105.0          main       2022-11-05 14:21:41
hyperfine          1.15.0           main       2022-11-05 14:22:08
jid                0.7.6            main       2022-11-05 14:22:30
jq                 1.6              main       2022-11-05 14:23:32
just               1.8.0            main       2022-11-05 14:23:46
lazygit            0.36.0           extras     2022-11-15 21:05:21
llvm               15.0.4           main       2022-11-05 16:31:03
lsd                0.23.1           main       2022-11-05 16:31:08
make               4.4              main       2022-11-05 16:31:19
mingit             2.38.1.windows.1 main       2022-11-05 11:46:47
mingw-nuwen        18.0             main       2022-11-05 16:36:36
msys2              2022-09-04       main       2022-11-05 16:37:24
neofetch           7.1.0            main       2022-11-05 16:37:26
neovide            0.10.3           extras     2022-11-14 10:05:06
neovim             0.8.0            main       2022-11-05 16:37:50
openssh            8.9.1.0p1        main       2022-11-05 11:48:09
oraclejdk17        17.0.3.1         destiny    2022-11-05 16:53:24
oraclejdk8         8u321            destiny    2022-11-05 16:54:46
posh-cargo         0.1.2.0          siku       2022-11-05 16:54:48
posh-docker        0.7.0            extras     2022-11-05 16:54:50
posh-git           1.1.0            extras     2022-11-05 16:54:52
powershell-preview 7.3.0-rc.1       destiny    2022-11-05 13:05:41
procs              0.13.3           main       2022-11-05 16:54:59
psreadline         2.2.6            extras     2022-11-05 16:55:00
refreshenv         2022.06.30       main       2022-11-05 16:55:39
ripgrep            13.0.0           main       2022-11-05 16:55:47
rustup-msvc        1.25.1           main       2022-11-05 17:14:00
scoop-completion   0.2.4            extras     2022-11-05 16:56:55
starship           1.11.0           main       2022-11-05 16:56:59
tdm-gcc            10.3.0           versions   2022-11-05 16:57:47
tinygo             0.26.0           main       2022-11-05 17:06:16
ttyd               1.7.2            main       2022-11-06 12:55:25
vcpkg              2022.10.19       main       2022-11-05 17:06:52
vcredist2010       10.0.40219.473   extras     2022-11-05 17:07:37
vcredist2022       14.34.31931.0    extras     2022-11-14 10:06:49
vhs                0.1.1            main       2022-11-06 12:55:30
vim                9.0              main       2022-11-05 17:10:32
vimtutor           0.2018.07.25     main       2022-11-05 17:10:33
wrangler           1.20.0           main       2022-11-05 17:10:38
youtube-dl         2021.12.17       main       2022-11-05 17:10:52
zig                0.10.0           main       2022-11-05 17:11:40
zoxide             0.8.3            main       2022-11-05 17:11:44
firacode-nf        2.2.2            nerd-fonts 2022-11-05 18:35:27 Global install
Noto-NF            2.2.2            nerd-fonts 2022-12-17 20:05:33 Global install
smiley-sans        1.0.0            nerd-fonts 2022-12-11 12:11:51 Global install