2017-10-20 75 views
0

我刚开始学习Haskell。我选择通过堆栈在PC上使用它。第一天,我和Chris Allen's tutorial一起工作,被卡在stack build部分。该命令返回一个错误,如下图所示:当涉及外部软件包时,堆栈会生成'找不到软件包'错误

C:\Users\USER\haskellProjects\bassbull>stack build 
primitive-0.6.2.0: download 
integer-logarithms-1.0.2: download 
primitive-0.6.2.0: configure 
primitive-0.6.2.0: build 
integer-logarithms-1.0.2: configure 
integer-logarithms-1.0.2: build 
primitive-0.6.2.0: copy/register 
integer-logarithms-1.0.2: copy/register 
Progress: 2/11Running C:\Users\USER\AppData\Local\Programs\stack\x86_64-windows\ 
ghc-8.0.2\bin\ghc-pkg.EXE --user --no-user-package-db --package-db C:\sr\snapsho 
ts\1602ab97\pkgdb describe --simple-output integer-logarithms --expand-pkgroot e 
xited with ExitFailure 1 

WARNING: cache is out of date: C:/Users/USER/AppData/Local/Programs/stack/x86_64 
-windows/ghc-8.0.2\lib\package.conf.d\package.cache 
ghc will see an old view of this package db. Use 'ghc-pkg recache' to fix. 
ghc-pkg.EXE: cannot find package integer-logarithms 

Running C:\Users\USER\AppData\Local\Programs\stack\x86_64-windows\ghc-8.0.2\bin\ 
ghc-pkg.EXE --user --no-user-package-db --package-db C:\sr\snapshots\1602ab97\pk 
gdb describe --simple-output primitive --expand-pkgroot exited with ExitFailure 
1 

WARNING: cache is out of date: C:/Users/USER/AppData/Local/Programs/stack/x86_64 
-windows/ghc-8.0.2\lib\package.conf.d\package.cache 
ghc will see an old view of this package db. Use 'ghc-pkg recache' to fix. 
ghc-pkg.EXE: cannot find package primitive 

C:\Users\USER\haskellProjects\bassbull>stack exec ghc-pkg recache 

C:\Users\USER\haskellProjects\bassbull>stack build 
integer-logarithms-1.0.2: configure 
integer-logarithms-1.0.2: build 
primitive-0.6.2.0: configure 
primitive-0.6.2.0: build 
integer-logarithms-1.0.2: copy/register 
primitive-0.6.2.0: copy/register 
Progress: 2/11Running C:\Users\USER\AppData\Local\Programs\stack\x86_64-windows\ 
ghc-8.0.2\bin\ghc-pkg.EXE --user --no-user-package-db --package-db C:\sr\snapsho 
ts\1602ab97\pkgdb describe --simple-output primitive --expand-pkgroot exited wit 
h ExitFailure 1 

ghc-pkg.EXE: cannot find package primitive 

Running C:\Users\USER\AppData\Local\Programs\stack\x86_64-windows\ghc-8.0.2\bin\ 
ghc-pkg.EXE --user --no-user-package-db --package-db C:\sr\snapshots\1602ab97\pk 
gdb describe --simple-output integer-logarithms --expand-pkgroot exited with Exi 
tFailure 1 

ghc-pkg.EXE: cannot find package integer-logarithms 

C:\Users\USER\haskellProjects\bassbull> 

尝试其他教程后,我的结论是,这个尝试安装外部包和依赖时,只发生。

请帮助我摆脱过去面临的挑战,因为我非常热衷于学习编码(和编码)Haskell。

回答

0

问题已解决。非常感谢Haskell堆栈组的Michael Sloan以及Google+上的Yuji Yamamoto on

我只是记录了我在这里做:

  • 我已经感觉到我的杀毒软件被搞乱的东西了(现在回想起来,种种迹象开始出现周回),所以我更新它。
  • 我做了一个干净的卸载堆栈,追捕其相关的文件/文件夹并将其擦除。
  • 然后我重新安装堆栈。
  • 并重新启动问题中提到的教程(不,Stack Overflow,我没有10分空闲,谢谢!)。
  • 我第一次做stack setup的时候确保连接到一个稳定的网络,这样一切都得到了轻松下载(另一次,连接超时无限时,获取ghc和msys)。
  • 完成后,我重新启动了shell。
  • ...和stack build成功完成。

现在,我不知道它对我来说究竟是什么,但我很乐意。如果它有帮助,我是(并且我仍然)在64位Windows7 PC上使用stack-1.5.1。

现在我不必为F#转储haskell。