“xz: Cannot exec” error when installing d12frosted/emacs-plus on homebrew

I want to try DoomEmacs as a scratchpad for quick notes while I’m working. I’m using the excellent FromScratch at the moment but I’m missing vim keybinds. As they say, after learning vim, any other text modality is like walking with a rock in your shoe.

I use this guide from Ethan Anderson and hit an error “xz: Cannot exec” when installing emacs-plus.

➜ arch -arm64 brew install emacs-plus
...
tar (child): xz: Cannot exec: No such file or directory
...

This error means that the required xz compression binaries aren’t installed on my machine. The easy fix is to install them using:

➜ arch -arm64 brew install xz 

I can now install emacs-plus successfully:

➜ arch -arm64 brew install emacs-plus

Full error trace

Full error trace

==> Installing d12frosted/emacs-plus/emacs-plus@28
...
tar (child): xz: Cannot exec: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now
Error: Failure while executing; `tar --extract --no-same-owner --file /Users/user/Library/Caches/Homebrew/downloads/81fae34a5dbd8042af6a70512829e9d4a11e31e7067bf4da5c5bded31f757129--emacs-28.1.tar.xz --directory /private/tmp/d20220818-3136-cvxxsn` exited with 2. Here's the output:
tar (child): xz: Cannot exec: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now