7

在 Mac OS X 上,我无法安装,ghc-mod因为无法安装名为“happy”的依赖项:

bash> cabal install ghc-mod                                                                                           
Resolving dependencies...
Configuring haskell-src-exts-1.17.1...
Failed to install haskell-src-exts-1.17.1
Build log ( /Users/meng/.cabal/logs/haskell-src-exts-1.17.1.log ):
Configuring haskell-src-exts-1.17.1...
setup-Simple-Cabal-1.22.5.0-x86_64-osx-ghc-7.10.3: The program 'happy' version
>=1.19 is required but it could not be found.
cabal: Error: some packages failed to install:
ghc-mod-5.5.0.0 depends on haskell-src-exts-1.17.1 which failed to install.
haskell-src-exts-1.17.1 failed during the configure step. The exception was:
ExitFailure 1
hlint-1.9.31 depends on haskell-src-exts-1.17.1 which failed to install.

任何想法?

4

2 回答 2

11

出于某种原因,cabal 不会安装可执行依赖项,但您可以通过手动安装来解决这个问题。

cabal install happy

然后继续进行原始安装。


这个问题通常也不会随着堆栈而消失,但解决方案是相似的

stack install happy

然后继续安装。

于 2016-03-05T20:58:51.250 回答
5

似乎该程序happy未安装在您的系统中,因此haskell-src-exts-1.17.1依赖于它的软件包(ghc-mod 的依赖项的依赖项)无法安装。

今天的普遍智慧,尤其是对于初学者来说,是不要使用该工具cabal-install,而是使用堆栈来代替您需要的一切。包括安装 ghc 本身。下载堆栈后,我认为您所要做的就是运行stack install ghc-mod安装ghc-mod

于 2016-03-05T20:58:42.610 回答