Error when adding CairoMakie in a fresh temporary environment

I forced to downgrade StatsBase to v0.22.21 installing it first and then installed CairoMakie without any problem. Is this the correct way to proceed?
Thanks.