How to fix error that occur when installing OCaml LSP?

how to fix this error?

opam install ocaml-lsp-server               

<><> Synchronising pinned packages ><><><><><><><><><><><><><><><><><><><><>  🐫 
[ocaml-lsp-server.1.15.1-5.0] synchronised (no changes)

[ERROR] Package conflict!
  * Incompatible packages:
    - (invariant) → ocaml-system >= 5.0.0
    - ocaml-lsp-server >= 1.15.1-5.0 → ocaml < 4.15 → dkml-base-compiler
    You can temporarily relax the switch invariant with `--update-invariant'

That version (the latest one) of ocaml-lsp-server requires ocaml v5.0 (as the message says).

It looks like you are running ocaml < 4.15. If you check the package page you should be able to select a version compatible with your installation. There is a drop-down control at the top of the page.

Then I think you just need to do opam install for the version you want.