代码之家  ›  专栏  ›  技术社区  ›  bradrn

互操作:来自堆栈的ghc配置不匹配

  •  5
  • bradrn  · 技术社区  · 7 年前

    什么时候 intero-mode 尝试自动安装Intero,会产生以下错误:

    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.
    

    这是在我升级到 lts-10.0 ,但在此之前,我在Intero方面遇到了问题(我在 https://github.com/commercialhaskell/intero/issues/499 ). 这里发生了什么,我如何修复它?我在Windows 10上使用emacs和SpaceMac。

    2 回复  |  直到 7 年前
        1
  •  2
  •   Michael Snoyman    7 年前

    我根本不是emacs专家,但我知道intero模式elisp文件指定了intero Haskell包的确切版本。您需要更新到更新的emacs包。我不知道您最初是如何安装intero模式的,但我猜(像我一样)您是从MELPA获得的。最终,我转向通过Git进行安装,以便更轻松地升级和测试MELPA上尚未发布的功能。您可以通过以下方式执行此操作:

    1. 克隆 https://github.com/commercialhaskell/intero 文件系统中的某个位置,例如。 ~/.emacs.d/vendor/intero
    2. 将这样的行添加到 ~/.emacs : (load-file "~/.emacs.d/vendor/intero/elisp/intero.el")
        2
  •  1
  •   Rik    7 年前

    第一 stack update 然后 stack install intero 安装最新版本的intero。