4

有人可以帮助我吗?!我在 C9 工作区的大学 Haskell Yesod 网站上工作,我已经通过命令 Yesod 安装并更新了 cabal,但是当我尝试“stack build”命令时,会出现以下可悲的错误消息:

 $ stack build

aulahaskell-0.0.0: build (lib + exe)
Preprocessing library aulahaskell-0.0.0...
[ 7 of 13] Compiling Handler.Cliente  ( src/Handler/Cliente.hs, .stack-work/dist/x86_64-linux/Cabal-1.24.2.0/build/Handler/Cliente.o )

/home/ubuntu/workspace/web2017/src/Handler/Cliente.hs:10:1: error:
    Failed to load interface for ‘Network.HTTP.Types.Status’
    It is a member of the hidden package ‘http-types-0.9.1’.
    Perhaps you need to add ‘http-types’ to the build-depends in your .cabal file.
    Use -v to see a list of the files searched for.

--  While building package aulahaskell-0.0.0 using:
      /home/ubuntu/.stack/setup-exe-cache/x86_64-linux/Cabal-simple_mPHDZzAJ_1.24.2.0_ghc-8.0.2 --builddir=.stack-work/dist/x86_64-linux/Cabal-1.24.2.0 build lib:aulahaskell exe:aulahaskell --ghc-options " -ddump-hi -ddump-to-file"
    Process exited with code: ExitFailure 1

说真的,我尝试了很多方法来修复它,但没有任何效果 =S

4

3 回答 3

5

只需仔细阅读错误消息:

Failed to load interface for ‘Network.HTTP.Types.Status’
It is a member of the hidden package ‘http-types-0.9.1’.
Perhaps you need to add ‘http-types’ to the build-depends in your .cabal file.
Use -v to see a list of the files searched for.

也许您需要在 .cabal 文件中的 build-depends 中添加 'http-types' 这一行告诉您该怎么做: 您必须在 cabal 文件中的aulahaskell库的build-depends 中添加http-types :部分。

如果这没有帮助,请发布您的 cabal 文件。

于 2017-11-14T19:28:42.137 回答
1

你是如何开始 yesod 项目的?建议这样做:

stack new my-yesod-project yesod-(your database here)
cd my-yesod-project
stack build
于 2017-11-14T17:30:07.073 回答
0

感谢你们!这是我如何启动项目的问题,我的工作区中没有安装一些文件,所以我删除了文件,重新安装 Yesod 和 cabal,按照以下步骤创建另一个新版本:https://www.yesodweb。 com/page/快速入门

于 2017-11-15T05:43:55.813 回答