6

When intero-mode tries automatically installing Intero, it produces the following error:

Intero is not installed in the Stack environment.

Installing intero-0.1.23 automatically ...


Error: While constructing the build plan, the following exceptions were encountered:

In the dependencies for intero-0.1.23:
    ghc-8.2.2 from stack configuration does not match >=7.8 && <8.2.2 (latest matching version
              is 8.2.1)
needed since intero is a build target.

Some potential ways to resolve this:

  * Recommended action: try adding the following to your extra-deps
    in <project directory>\stack.yaml:

- ghc-8.2.1

  * Set 'allow-newer: true' to ignore all version constraints and build anyway.

  * You may also want to try using the 'stack solver' command.

Plan construction failed.
Could not install Intero!

We don't know why it failed. Please read the above output and try
installing manually. If that doesn't work, report this as a
problem.

WHAT TO DO NEXT

If you don't want to Intero to try installing itself again for
this project, just keep this buffer around in your Emacs.

If you'd like to try again next time you try use an Intero
feature, kill this buffer.

This started happening after I upgraded to lts-10.0, but even before that I was having problems with Intero (I reported it at https://github.com/commercialhaskell/intero/issues/499). What is happening here and how can I fix it? I'm using emacs and spacemacs on Windows 10.

bradrn
  • 8,337
  • 2
  • 22
  • 51
  • 1
    Try again with intero-0.1.24 which appears to be compatible with ghc-8.2.2. – sjakobi Dec 30 '17 at 09:09
  • How do I go about doing this? As far as I can see emacs doesn't give me any option to specify the intero version. – bradrn Dec 31 '17 at 03:14
  • I'm not quite sure actually. Simply running `stack install intero-0.1.24` might work. Or add `intero-0.1.24` to the `extra-deps` section in your `stack.yaml`. – sjakobi Dec 31 '17 at 14:45
  • `stack build intero-0.1.24` (which seems to be the proper way to do it, as intero isn't supposed to be installed globally) results in an error `The wrong version of Intero is installed for this Emacs package.`, followed by another attempted installation of `intero-0.1.23`. Adding it to `extra-deps` doesn't do anything. I also noticed that `intero-0.1.24` doesn't seem to be [released](https://github.com/commercialhaskell/intero/releases) yet... – bradrn Jan 01 '18 at 07:40
  • The release is listed on [Hackage](https://hackage.haskell.org/package/intero-0.1.24). Try opening a GitHub issue to get more competent help. Also use the `haskell` tag next time for more visibility. – sjakobi Jan 01 '18 at 18:19

2 Answers2

2

I'm not at all an emacs expert, but I do know that the intero-mode elisp files specify an exact version of the intero Haskell package. You'll need to update to the newer emacs package. I don't know how you installed intero-mode in the first place, but I'm going to guess that (like me) you got it off MELPA. Ultimately I moved over to installing via Git so I could more easily upgrade and test features that hadn't been released on MELPA yet. You can do this by:

  1. Cloning https://github.com/commercialhaskell/intero somewhere on your filesystem, e.g. ~/.emacs.d/vendor/intero
  2. Add a line like this to ~/.emacs: (load-file "~/.emacs.d/vendor/intero/elisp/intero.el")
Michael Snoyman
  • 31,100
  • 3
  • 48
  • 77
1

First stack update and then stack install intero to install latest version of intero.

Rik
  • 111
  • 4