Yesod 和堆栈中缺少 cabal 依赖项

cabal dependencies are missing in Yesod and stack

您好,我尝试使用堆栈为 yesod 创建一个新项目,请遵循 quickstart 教程;要创建脚手架,我使用命令:

stack new my-project yesod-postgres && cd my-project

但是当运行stack exec -- yesod devel得到:

cabal: At least the following dependencies are missing:
classy-prelude >=0.10.2,
classy-prelude-conduit >=0.10.2,
classy-prelude-yesod >=0.10.2,
data-default -any,
hjsmin >=0.1 && <0.3,
monad-logger ==0.3.*,
persistent >=2.0 && <2.6,
persistent-postgresql >=2.1.1 && <2.6,
persistent-template >=2.0 && <2.6,
safe -any,
yesod >=1.4.3 && <1.5,
yesod-auth >=1.4.0 && <1.5,
yesod-core >=1.4.17 && <1.5,
yesod-form >=1.4.0 && <1.5,
yesod-static >=1.4.0.3 && <1.6

我尝试使用命令 stack exec -- cabal install 但得到:

cabal: Use of GHC's environment variable GHC_PACKAGE_PATH is incompatible with
Cabal. Use the flag --package-db to specify a package database (it can be used multiple times).

感谢您的帮助

编辑

在ubuntu中安装postgres库的命令:

sudo apt-get install -y libpq-dev

Yesod quick start page中所述,您必须在项目中执行此操作:

stack build yesod-bin cabal-install --install-ghc
stack build

然后,

stack exec -- yesod devel