我正在尝试安装
stack install ghc-mod
我遇到以下错误:
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.
Some potential ways to resolve this:
* Recommended action: try adding the following to your extra-deps in /home/developer/.stack/global-project/stack.yaml:
- Cabal-1.24.2.0
- base-4.9.1.0
- cabal-helper-0.7.3.0
- extra-1.5.3
- monad-journal-0.7.2
- optparse-applicative-0.13.2.0
* 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.
我正在使用
~/.local/bin$ stack --version
Version 1.6.3, Git revision b27e629b8c4ce369e3b8273f04db193b060000db (5454 commits) x86_64 hpack-0.20.0
和ghc版本8.2.2。如何绕过错误?
答案 0 :(得分:4)
您的stackage版本没有该程序包https://www.stackage.org/lts-10.4/hoogle?q=ghc-mod。旧的有https://www.stackage.org/lts-8.23/hoogle?q=ghc-mod。我认为套餐被认为是不受维护的,因为它最后一次更新是在2017年7月。
您可以阅读有关如何从hackage添加任何软件包的官方文档,特别是外部依赖项https://github.com/commercialhaskell/stack/blob/master/doc/GUIDE.md#external-dependencies
但是,最新的Haskell版本可能会破坏。
答案 1 :(得分:3)
对于lts-10.4,您可以在最底部使用提及的here解决方法: 在extra-deps下的stack.yaml中安装ghc-mod-5.9.0.0的候选版本以及更多的软件包。然后做一个
stack build ghc-mod
stack install ghc-mod
你完成了。至少&#34;适合我&#34;在ghc-8.2.2下:
ghc-mod --version
$> ghc-mod version 5.9.0.0 compiled by GHC 8.2.2
我还没有遇到任何与原子一起使用它的问题。 希望这会有所帮助。