Dune keyword is not recognised, but dune is installed

I installed Ocaml on Windows, and tried the running the following:

with-dkml dune build test.exe

However, the keyword dune is not recognised:

/c/Users/shuri/AppData/Local/Programs/DKMLNA~1/tools/MSYS2/usr/bin/env: 'dune': No such file or directory

I checked that dune is installed with:

opam install dune

It tells me that:

[NOTE] Package dune is already installed (current version is 3.15.0).

Also

dune --version

does not work:

dune: The term 'dune' is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

Could you please suggest a fix?

What does:

opam exec -- dune --version

give you?

At this point it would be much simpler to remove completely the dkml distribution. Thanks, for trying to help.