Ryo*_*Oka 2 haskell haskell-stack
我收到此错误:
Could not find module ‘Data.Binary’
It is a member of the hidden package ‘binary-0.7.5.0@binar_IvYoLp9H6Xy3zEH13MmZwd’.
Run Code Online (Sandbox Code Playgroud)
当我Data.Binary使用GHCi版本7.10.2 导入我的堆栈项目时.
奇怪的是,如果我执行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'
Run Code Online (Sandbox Code Playgroud)
你会如何解决这个问题?
添加binary依赖项到您的cabal文件.
build-depends: base >= 4.7 && < 5
, binary >= 0.7.5
Run Code Online (Sandbox Code Playgroud)
当您使用时,stack install您正在安装某些库或可执行文件但不是作为依赖项(例如,yesod您只在内部使用的实用程序或某些库ghci...).