2

次のエラーが表示されます。

Could not find module ‘Data.Binary’
It is a member of the hidden package ‘binary-0.7.5.0@binar_IvYoLp9H6Xy3zEH13MmZwd’.

Data.BinaryGHCi バージョン 7.10.2 を使用してスタック プロジェクトにインポートします。

奇妙なことに、GHCi を介して GHCi を実行すると、これが表示されず、スタックを介してパッケージstack exec ghciの新しいバージョンをインストールできないことです。次のbinaryようになります。

D:\p>stack install binary
Setting codepage to UTF-8 (65001) to ensure correct output from GHC
NOTE: the install command is functionally equivalent to 'build --copy-bins'

D:\p>stack install binary-0.7.6.1
Setting codepage to UTF-8 (65001) to ensure correct output from GHC
NOTE: the install command is functionally equivalent to 'build --copy-bins'
Error parsing targets: Specified target version 0.7.6.1 for package binary does not match snapshot version 0.7.5.0

D:\p>stack install binary-0.7.5.0
Setting codepage to UTF-8 (65001) to ensure correct output from GHC
NOTE: the install command is functionally equivalent to 'build --copy-bins'

この問題をどのように回避しますか?

4

1 に答える 1

5

binaryファイルに依存関係を追加しcabalます。

build-depends:       base >= 4.7 && < 5
                   , binary >= 0.7.5

使用するstack install場合、特定のライブラリまたは実行可能ファイルをインストールしていますが、依存関係としてではありません(たとえば、ユーティリティのようなものyesodや、内部でのみ使用しているライブラリですghci...)。

于 2015-09-11T08:32:17.077 に答える