Try How does one pin/freeze a version of the dependencies of an opam project/package and then install the project with such specified dependencies? - #7 by kit-ty-kate