无法安装由于'开心'而无法安装ghc-mod?
问题描述:
在Mac OS X,我无法安装ghc-mod
由于不能安装一个名为“快乐的”依赖性:无法安装由于'开心'而无法安装ghc-mod?
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.
任何想法?
答
由于某些原因,cabal不会安装可执行文件依赖项,但您可以通过手工安装来解决此问题。
cabal install happy
然后继续进行原始安装。
这个问题通常不会消失与堆下去,但解决的办法是类似
stack install happy
然后继续进行安装。
答
它似乎程序happy
未安装在您的系统中,因此依赖于它的程序包haskell-src-exts-1.17.1
(依赖于ghc-mod的依赖项)无法安装。
今天的普遍看法,特别是对初学者来说,是不要使用工具cabal-install
,而是使用stack来代替您需要的所有东西。包括安装ghc本身。下载堆栈后,我认为你所要做的就是运行stack install ghc-mod
来安装ghc-mod
。
我知道还有一点需要学习,但考虑使用'stack'或'cabal sandboxes',对于后者你最好做一个'cabal get ghc-mod',然后cd进入ghcmod目录,在那里你可以做'cabal sandbox init'这会让你的生活更容易Haskell。使用'stack'甚至更好,但已经有推荐的答案。 – epsilonhalbe