Can't install ghc-mod because of the "happy" can't be installed?

On Mac OS X, I cannot install ghc-mod due to the fact that it is not possible to install the dependency "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. 

Any idea?

+6
source share
2 answers

For some reason, cabal does not install executable dependencies, but you can work around this by manually installing it.

 cabal install happy 

then perform the initial installation.


This problem usually does not go away with the stack, but the solution is similar

 stack install happy 

then continue the installation.

+9
source

it seems that the happy program is not installed on your system, so the haskell-src-exts-1.17.1 (ghc-mod dependency dependency), which is independent of it, cannot be installed.

The common wisdom today, especially for beginners, is not to use the cabal-install tool, but to use stack for everything you need instead. including installing ghc itself. after loading the stack, I think all you have to do is run stack install ghc-mod to install ghc-mod .

+5
source

All Articles