I used the latest Haskell Platform 7.10.2-a (https://www.haskell.org/platform/mac.html) on Mac OS X 10.11 for El-capitan.
When I tried to install yesod
with cabal install yesod
, I have multiple error messages such as:
Building email-validate-2.1.3...
Building http-api-data-0.2.1...
Building fast-logger-2.4.1...
Building http-date-0.0.6.1...
Failed to install crypto-random-0.0.9
Build log ( /Users/smcho/.cabal/logs/crypto-random-0.0.9.log ):
Configuring crypto-random-0.0.9...
Building crypto-random-0.0.9...
Preprocessing library crypto-random-0.0.9...
<command line>: cannot satisfy -package-id vector-0.11.0.0-730f99979d41c11c3a1ef069844b5f57
(use -v for more information)
Failed to install email-validate-2.1.3
Build log ( /Users/smcho/.cabal/logs/email-validate-2.1.3.log ):
Configuring email-validate-2.1.3...
The error pattern is pretty much the same: cannot satisfy -package-id
.
For example, cabal install aeson
gives cannot satisfy -package-id attoparse...
error.
Resolving dependencies...
Configuring aeson-0.10.0.0...
Building aeson-0.10.0.0...
Failed to install aeson-0.10.0.0
Build log ( /Users/smcho/.cabal/logs/aeson-0.10.0.0.log ):
Configuring aeson-0.10.0.0...
Building aeson-0.10.0.0...
Preprocessing library aeson-0.10.0.0...
<command line>: cannot satisfy -package-id attoparsec-0.13.0.1-99b4df28644e63383f308c810764a8bb
(use -v for more information)
cabal: Error: some packages failed to install:
aeson-0.10.0.0 failed during the building phase. The exception was:
ExitFailure 1
However, attoparsec library seems to be installed without problem.
smcho@macho ~> cabal install attoparsec
Resolving dependencies...
All the requested packages are already installed:
attoparsec-0.13.0.1
Use --reinstall if you want to reinstall anyway.
What might be wrong?
答案 0 :(得分:3)
根据建议here,您看到的cannot satisfy -package-id
错误可能是由于过期缓存造成的。
如果正在运行ghc-pkg check
警告您缓存已过期,则运行ghc-pkg recache
可能会解决您的问题。
我整个上午都遇到了cannot satisfy -package-id
问题(不是使用yesod,而是使用其他各种软件包)。 ghc-pkg recache
解决了我的问题。希望这会有所帮助。
答案 1 :(得分:1)
答案 2 :(得分:1)
我可以从brew安装yesod。
/Library/Haskell/bin/uninstall-hs thru 7.10.2
brew install ghc
brew link ghc
brew install haskell-stack
stack install yesod
stack install yesod-bin
stack runghc hello-world.hs
stack exec yesod build
。stack exec yesod devel
。 stack exec yesod keter
,你将在dist / bin中获得一个包含大部分必要文件的二进制文件。