我正在尝试安装特定版本的template-haskell-2.17.0.0。我运行这个命令,但是在解决依赖关系时得到一个错误:
❯ cabal install template-haskell-2.17.0.0 --lib
Resolving dependencies...
cabal: Could not resolve dependencies:
[__0] next goal: template-haskell (user goal)
[__0] rejecting: template-haskell-2.18.0.0 (constraint from user target
requires ==2.17.0.0)
[__0] rejecting: template-haskell-2.17.0.0 (constraint from user target
requires ==2.16.0.0)
[__0] rejecting: template-haskell-2.16.0.0/installed-2.16.0.0,
template-haskell-2.16.0.0, template-haskell-2.15.0.0,
template-haskell-2.14.0.0, template-haskell-2.13.0.0,
template-haskell-2.12.0.0, template-haskell-2.11.1.0,
template-haskell-2.11.0.0, template-haskell-2.10.0.0,
template-haskell-2.9.0.0, template-haskell-2.8.0.0, template-haskell-2.7.0.0,
template-haskell-2.6.0.0, template-haskell-2.5.0.0, template-haskell-2.4.0.1,
template-haskell-2.4.0.0, template-haskell-2.3.0.1, template-haskell-2.3.0.0,
template-haskell-2.2.0.0 (constraint from user target requires ==2.17.0.0)
[__0] fail (backjumping, conflict set: template-haskell)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: template-haskell我用的是最新的阴谋版本:
❯ cabal --version
cabal-install version 3.6.2.0
compiled using version 3.6.3.0 of the Cabal library发布于 2022-04-19 20:48:10
有些软件包带有GHC,不能重新安装。这些都被称为“引导”包。template-haskell包就是其中一个引导包。您可以在这里找到一个完整的列表:https://gitlab.haskell.org/ghc/ghc/-/wikis/commentary/libraries/version-history。
对于您的特殊情况,template-haskell-2.17.0.0是GHC 9.0.2 (或9.0.1)的一部分。安装该版本的template-haskell的唯一方法是使用适当的GHC版本。
根据错误输出,我猜您使用的是某个版本的GHC 8.10.x,可能是8.10.7。您没有提到如何安装GHC,所以我不知道具体如何告诉您如何升级。如果您使用GHCup,那么您应该能够使用以下命令升级GHC:
ghcup install ghc 9.0.2 --sethttps://stackoverflow.com/questions/71929447
复制相似问题