cabal安装依赖性错误:"base-*被排除在外,因为顶级依赖基础-any"

jam*_*her 7 dependencies haskell cabal

这是完整的错误:

$ cabal install hakyll
Resolving dependencies...
cabal: cannot configure snap-server-0.5.3.1. It requires base >=4.3 && <5
For the dependency on base >=4.3 && <5 there are these packages: base-4.3.0.0,
base-4.3.1.0 and base-4.4.0.0. However none of them are available.
base-4.3.0.0 was excluded because of the top level dependency base -any
base-4.3.1.0 was excluded because of the top level dependency base -any
base-4.4.0.0 was excluded because of the top level dependency base -any
$
Run Code Online (Sandbox Code Playgroud)

base-*由于某些规则似乎可以说任何版本都没有问题,如何排除版本?

Dan*_*ner 3

每次我遇到这个问题,都是因为我做了以下所有事情:

  1. 从 Hackage 下载了一个具有过时依赖项的软件包。
  2. 更新了依赖项并观察到它构建得很好(或者花时间修复发生的任何错误)。
  3. 使用新的依赖项运行cabal install
  4. 没有更新版本号。

最后一个才是真正的关键。cabal install将假设,如果它从 Hackage 知道包的版本/依赖项对,则该对是规范的。如果您希望它了解更新的依赖项,请在安装之前更改包的版本号。

您需要检查您是否已对手动安装的任何 hakyll 依赖项正确执行此操作。