2

I want to test this project: https://github.com/nt591/monkey-ocaml on my Mac. After downloading the project, dune runtest returned the following error:

$ dune runtest
File "dune-project", line 1, characters 11-15:
1 | (lang dune 1.11)
               ^^^^
Error: Version 1.11 of dune is not supported.
Supported versions:
- 0.0
- 1.0 to 1.6

Then, I followed this suggestion, but it returned this:

$ dnf remove dune
-bash: dnf: command not found

Do I have to install dnf? Could anyone help?

glennsl
  • 28,186
  • 12
  • 57
  • 75
SoftTimur
  • 5,630
  • 38
  • 140
  • 292
  • How did you install `dune`? `dnf` is what was used to install it in the question you reference, so that's what needs to be used to remove it as well. – glennsl Jan 08 '20 at 03:54
  • I don't remember how I installed dune. `dune --version` returned `1.6.3`. – SoftTimur Jan 08 '20 at 03:56
  • I don't think anyone else will be able to remember it for you either, or know which package managers you might have installed, so I guess you'll just have to try. `brew` seems a likely culprit on macOS, or maybe you've installed it with `opam` and just have to update. `which dune` might help you figure it out. – glennsl Jan 08 '20 at 03:59
  • `which dune` returned `/Users/SoftTimur/.opam/system/bin/dune`. – SoftTimur Jan 08 '20 at 04:03
  • 2
    `opam update && opam upgrade` should fix it then. – glennsl Jan 08 '20 at 04:04
  • Unless you have an old version of `opam`, which you probably do, so maybe upgrade that too. – glennsl Jan 08 '20 at 04:05
  • 1
    Just `opam update && opam upgrade` and then `opam install alcotest fmt` solved the problem. Thank you. – SoftTimur Jan 08 '20 at 04:18

1 Answers1

2

Solved in the comments, but in case anyone else stumbles across this, dune was installed with opam but out of date, so the fix was a simple opam update && opam upgrade.

If dune is installed in some other way, it's strongly recommended that you uninstall that instance and install it using `opam´ instead.

glennsl
  • 28,186
  • 12
  • 57
  • 75