On Mac OS X, I'm not able to install ghc-mod
due to that a dependency called 'happy' cannot be installed:
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.
Any idea?
For some reason, cabal doesn't install executable dependencies, but you can get around this by installing by hand.
cabal install happy
then proceed with the original installation.
This problem generally doesn't go away with stack either, but the solution is similar
stack install happy
then continue with the installation.
it seems the program happy
is not installed in your system, therefore the package haskell-src-exts-1.17.1
(a dependency of a dependency of ghc-mod) which depends on it fails to install.
The common wisdom today, especially for beginners, is to not use the tool cabal-install
, but to use stack for everything you need instead. including installing ghc itself. after downloading stack I think all you have to do is run stack install ghc-mod
to install ghc-mod
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With