繁体   English   中英

由于“基础版本无法使用”,无法安装ghc-mod

[英]Cannot install ghc-mod due to “unattainable version of base”

我正在尝试在Windows上安装ghc-mod库。 使用stack install ghc-mod显示以下冗长的错误消息:

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

In the dependencies for ghc-mod-5.8.0.0:
    Cabal-2.4.1.0 from stack configuration does not match >=1.18 && <1.25  (latest matching version is 1.24.2.0)
    base-4.12.0.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)
    djinn-ghc must match <0.1 && >=0.0.2.2, but the stack configuration has no specified version  (latest matching
              version is 0.0.2.3)
    extra-1.6.17 from stack configuration does not match <1.6 && >=1.4  (latest matching version is 1.5.3)
    ghc-8.6.5 from stack configuration does not match >=7.6 && <8.2
    ghc-syb-utils must match <0.3 && >=0.2.3, but the stack configuration has no specified version  (latest matching
                  version is 0.2.3.3)
    haskell-src-exts-1.20.3 from stack configuration does not match <1.20 && >=1.18  (latest matching version is 1.19.1)    hlint-2.1.11 from stack configuration does not match <2.1 && >=2.0.8  (latest matching version is 2.0.15)
    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.3.0 from stack configuration does not match >=0.13.0.0 && <0.14  (latest matching version
                                  is 0.13.2.0)
    temporary-1.3 from stack configuration does not match <1.3 && >=1.2.0.3  (latest matching version is 1.2.1.1)
needed since ghc-mod is a build target.

Some different approaches to resolving this:

  * Build requires unattainable version of base. Since base is a part of GHC, you most likely need to use a different
    GHC version with the matching base.

显然,我需要更改ghc的版本,但是我的版本高于所需的版本,因此更新无济于事。 我应该降级吗? 如何在不弄乱我的ghc生态系统其余部分的情况下做到这一点?

使用cabal进行安装可获得类似的结果。

堆栈中,您可以找到所有LTS版本以及可以下载的所有可能的发行版:

在此处输入图片说明

是ghc-mod需要的所有依赖项的列表:

在此处输入图片说明

您需要检查是否没有任何过时或无法匹配的内容。

抱歉,除非您愿意降级到GHC 8.0,否则您无法这样做。 请注意,在依赖项列表中它表示ghc (>=7.6 && <8.2) 没有GHC 8.1(奇数用于测试),因此它可以追溯到GHC 8.0。

Stackage提供了已知可一起编译的软件包版本的精选列表,以及GHC的版本。 每个长期支持(LTS)都是这些版本的特定集合。 从DamiánRafael Lattenero发布的列表中可以看到,这意味着可以追溯到LTS-9.21

问题是ghc-mod使用GHC作为库和编译器,因此它对版本非常敏感,并且ghc-mod和所开发的软件都必须使用相同版本的编译器。 有了ghc-mod的工作版本,您不能只为自己的程序切换到更高版本的GHC。

假设您仍然想要这样做,请安装stack 然后编辑您的~/.stack/config.yaml文件(在Windows上,键入stack path --stack-root以查找该文件的存储位置)。 将其更改为resolver: lts-9.21 然后说stack install ghc-mod

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM