ghc-mod doesn't yet support GHC 8.2 or later[1]. You'll need to use an older version of the compiler if you want ghc-mod support. If you check out ghc-mod's Stackage page[2], you can see that the latest snapshots supporting it are lts-8.24 and nightly-2017-06-28, so those are options if you need ghc-mod support. Note, however, that they're relatively old, so may be missing other things you want.

I wrote a blog post recently about selecting older snapshots for building tools[3], which may be helpful.

[1] On the Hackage page (http://hackage.haskell.org/package/ghc-mod), you can see that it says base < 4.10. On this page (https://www.snoyman.com/base), you can see that 4.10 ships with GHC 8.2. base is a library which cannot be upgraded.
[2] https://www.stackage.org/package/ghc-mod
[3] https://www.snoyman.com/blog/2018/05/building-packages-outside-snapshots

On Thu, May 24, 2018 at 1:12 PM Dinesh Amerasekara <ddinesh31@yahoo.com> wrote:
Hi,

When I executed the command stack install ghc-mod, it gave me the following error.

In the dependencies for ghc-mod-5.8.0.0:

    Cabal-2.0.1.1 from stack configuration does not match >=1.18 && <1.25  (latest matching version is 1.24.2.0)
    base-4.10.1.0 from stack configuration does not match >=4.6.0.1 && <4.10  (latest matching version is 4.9.1.0)
    cabal-helper must match <0.8 && >=0.7.3.0, but the stack configuration has no specified version  (latest matching version is 0.7.3.0)
    extra-1.6.2 from stack configuration does not match <1.6 && >=1.4  (latest matching version is 1.5.3)
    ghc-8.2.2 from stack configuration does not match >=7.6 && <8.2 
    monad-journal-0.8.1 from stack configuration does not match <0.8 && >=0.4  (latest matching version is 0.7.2)
    optparse-applicative-0.14.0.0 from stack configuration does not match >=0.13.0.0 && <0.14  (latest matching version is 0.13.2.0)

needed since ghc-mod is a build target.

Can I get an advice to solve this error?

Thanks And Best Regards,
Dinesh
_______________________________________________
Beginners mailing list
Beginners@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners