[英]Haskell cabal issue with Mac OS X 10.11? (cannot satisfy -package-id)
我在Mac OS X 10.11上針對El-capitan使用了最新的Haskell平台7.10.2-a( https://www.haskell.org/platform/mac.html )。
當我試圖安裝yesod
與cabal install yesod
,我有多個錯誤消息,例如:
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...
錯誤模式幾乎相同: cannot satisfy -package-id
。
例如, cabal install aeson
給出的cannot satisfy -package-id attoparse...
錯誤。
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
但是,似乎已成功安裝了attoparsec庫。
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.
可能是什么問題?
作為建議在這里 ,在cannot satisfy -package-id
,你所看到的可能是錯誤由於過時緩存。
如果運行ghc-pkg check
警告您緩存已過期,則運行ghc-pkg recache
可能會解決您的問題。
我整個上午都在遇到cannot satisfy -package-id
問題(不是使用yesod,而是使用其他各種軟件包)。 ghc-pkg recache
解決了我的問題。 希望這可以幫助。
這可能是有爭議的,但是隨着stack的出現,haskell平台和cabal(直接使用時)現在已基本棄用。
堆棧將:
stack setup
) 我可以從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中獲得一個二進制文件,其中包含要運行的大多數必需文件。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.