2017-10-20 77 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。