How install dependencies from `dune-project`?

How can I install specified dependencies in the dune-project file?

There is an opam file but it is empty, is dummy.opam


(dirs src reanalyze vendor)


(lang dune 2.0)

 (name test)
 (synopsis "test")
   (>= 4.10))
   (= 0.22.4))
   (= 2.23.0))

Is there something similar to npm install?

I created a switch using opam switch create ., but did not install ocamformat=0.22.4

It’s possible to generate an .opam file from dune-project: opam Integration — Dune documentation.

Although usually that would be already done by the project maintainer and committed into the repository (and kept in sync thereafter).

1 Like

Yes indeed, without (generate_opam_files true) specifying the dependencies yields no advantages at the moment since dune does not deal with OPAM packages for the most part.