`Cabal install` is fragile and can fail if the GHC on path is of an incompatible version. Use ghcup to use a GHC version that is known to work.