Ocaml esy not working

Has anyone been able to get the tool “esy” for building ocaml projects working?
I have tried installing it using the standard package:
nodePackages.esy
using npm
using yarn
Running it using “npx esy”
All i get is the same error again and again:

esy: internal error, uncaught exception:
     Unix.Unix_error(Unix.EACCES, "open", "/home/eli/.esy/3/b/esy_ocaml__s__substs-0.0.1-ed6217b4.log")

I even tried getting it running inside an FHS nix-shell, that didn’t seem to help.
Any advice much appreciated.