首页 > 解决方案 > Yesod 快速入门在堆栈构建时失败

问题描述

我昨晚尝试做 yesod 快速入门指南,在第 4 步运行stack build时出现错误

Error parsing targets: The specified targets matched no packages. Perhaps you need to run 'stack init'?

运行stack init也会产生很大的错误

有什么解决办法吗?

编辑:从stack init命令中添加错误

Looking for .cabal or package.yaml files to use to init the project.
Using cabal packages:
- ./

Selecting the best among 15 snapshots...

* Partially matches lts-13.21
    aeson version 1.4.2.0 found
        - edb-yesod requires >=0.6 && <1.4
    classy-prelude version 1.5.0 found
        - edb-yesod requires ==1.4.*
    classy-prelude-conduit version 1.5.0 found
        - edb-yesod requires ==1.4.*
    classy-prelude-yesod version 1.5.0 found
        - edb-yesod requires ==1.4.*
    persistent version 2.9.2 found
        - edb-yesod requires ==2.8.*
    persistent-sqlite version 2.9.3 found
        - edb-yesod requires ==2.8.*
    yaml version 0.11.0.0 found
        - edb-yesod requires ==0.8.*
    Using package flags:
        - edb-yesod: dev = False, library-only = False

Downloaded nightly-2019-05-18 build plan.    
Unable to load cabal files for snapshot

----
Deleting cached snapshot file: /home/decapo/.stack/build-plan/nightly-2019-05-18.yaml
Recommendation: try running again. If this fails again, open an upstream issue at:
https://github.com/fpco/stackage-nightly/issues/new
----

Unable to parse cabal file for co-log-0.3.0.0@sha256:0eb5cf2598c3673f39a8e967a6a4f5043f4d1f1fcb50a844653c34fcf0cb068a,4508

- 0:0: Unsupported cabal-version. See https://github.com/haskell/cabal/issues/4899.

编辑 2

从堆栈新的 yesod-sqlite 模板添加输出

» stack new my-project-du yesod-sqlite
Downloading template "yesod-sqlite" to create project "my-project-du" in my-project-du/ ...
Looking for .cabal or package.yaml files to use to init the project.
Using cabal packages:
- my-project-du/

Selecting the best among 15 snapshots...

* Partially matches lts-13.21
    aeson version 1.4.2.0 found
        - my-project-du requires >=0.6 && <1.4
    classy-prelude version 1.5.0 found
        - my-project-du requires ==1.4.*
    classy-prelude-conduit version 1.5.0 found
        - my-project-du requires ==1.4.*
    classy-prelude-yesod version 1.5.0 found
        - my-project-du requires ==1.4.*
    persistent version 2.9.2 found
        - my-project-du requires ==2.8.*
    persistent-sqlite version 2.9.3 found
        - my-project-du requires ==2.8.*
    yaml version 0.11.0.0 found
        - my-project-du requires ==0.8.*
    Using package flags:
        - my-project-du: dev = False, library-only = False

Unable to load cabal files for snapshot

----
Deleting cached snapshot file: /home/decapo/.stack/build-plan/nightly-2019-05-18.yaml
Recommendation: try running again. If this fails again, open an upstream issue at:
https://github.com/fpco/stackage-nightly/issues/new
----

Unable to parse cabal file for co-log-0.3.0.0@sha256:0eb5cf2598c3673f39a8e967a6a4f5043f4d1f1fcb50a844653c34fcf0cb068a,4508

- 0:0: Unsupported cabal-version. See https://github.com/haskell/cabal/issues/4899.

看起来类似于 stack init 命令。有关我的系统的详细信息,我正在运行 ubuntu mate 18.04 64 位。

标签: yesod

解决方案


推荐阅读