这是 stack.yaml 节
包:
- location:
git: https://github.com/TwitterFriends/lsh.git
commit: 57d57f4209e56f526c0eca023907015935c26071
extra-dep: true
我将包添加到 cabal 文件
尝试构建时出现错误
While constructing the BuildPlan the following exceptions were encountered:
-- While attempting to add dependency,
Could not find package lsh in known packages
我做错了什么?
此处找到当前项目
最佳答案
问题是语法。您在 extra-dep
之前添加了一些额外的空格。将其放入 stack.yaml 中。这样,您的项目就可以在我的机器上构建了。
- location:
git: https://github.com/TwitterFriends/lsh.git
commit: 57d57f4209e56f526c0eca023907015935c26071
extra-dep: true
更新:(2017 年 12 月 17 日)
自 stack-1.6.1
添加 github 依赖项的语法已更改。您需要将 github 依赖项添加到 extra-deps
字段中。像这样的事情:
resolver: lts-9.17
packages: [.]
extra-deps:
- fmt-0.5.0.0
- git: https://github.com/TwitterFriends/lsh.git
commit: 57d57f4209e56f526c0eca023907015935c26071
更新:(2019 年 12 月 5 日)
在 stack-2.1.3
中,您可以使用更短的语法在 extra-deps
中指定 GitHub 依赖项:
extra-deps:
- github: TwitterFriends/lsh
commit: 57d57f4209e56f526c0eca023907015935c26071
关于haskell - stack.yaml 没有从 github 中提取依赖项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43789271/