gpt4 book ai didi

haskell - haskell-stack 出现奇怪的错误。它不再安装任何东西

转载 作者:行者123 更新时间:2023-12-02 11:43:15 25 4
gpt4 key购买 nike

我在尝试安装软件包时遇到堆栈错误。

Run from outside a project, using implicit global project config
Using resolver: lts-8.0 from implicit global project's config file: /home/chuck/.stack/global-project/stack.yaml
Invalid package ID: "array-0.5.1.1 base-4.9.1.0 binary-0.8.3.0 bytestring-0.10.8.1"

堆栈 --version 有效:

Version 0.1.10.0 x86_64

堆栈设置返回以下内容:

Run from outside a project, using implicit global project config
Using resolver: lts-8.0 from implicit global project's config file: /home/chuck/.stack/global-project/stack.yaml
stack will use a locally installed GHC
For more information on paths, see 'stack path' and 'stack exec env'
To use this GHC and packages outside of a project, consider using:
stack ghc, stack ghci, stack runghc, or stack exec

我重新安装了堆栈,但在新安装后出现了相同的错误。所以,我不知道我做错了什么。我需要它来使用原子。

编辑

堆栈.yaml:

# This is the implicit global project's config file, which is only used when
# 'stack' is run outside of a real project. Settings here do _not_ act as
# defaults for all projects. To change stack's default settings, edit
# '/home/chuck/.stack/config.yaml' instead.
#
# For more information about stack's configuration, see
# https://github.com/commercialhaskell/stack/blob/release/doc/yaml_configuration.md
#
flags: {}
extra-package-dbs: []
packages: []
extra-deps: []
resolver: lts-8.0

最佳答案

在尝试了很多事情之后,我“找到了答案”。

正如 epsilonhalbe 所见,问题是我有一个旧版本。所以我尝试这样做wget -qO- https://get.haskellstack.org/ | sh它不起作用,因为我的堆栈位于 /usr/bin/所以,我删除了堆栈,然后再次尝试 wget -qO- https://get.haskellstack.org/ | sh 。我添加了$HOME/.local/bin/到路径,并且它工作正常。

希望对大家有帮助

编辑

有一个新版本的堆栈,但是 ghc-mod一直工作到 lts-9.0堆栈。所以,如果您遇到 ghc-mod 的问题并且您的堆栈版本已结束8.0.2然后:

nano /Users/USERNAME/.stack/global-project/stack.yaml

并替换resolver: ---对于 resolver: lts-9.0

然后,在终端 stack solver它会起作用的:)

关于haskell - haskell-stack 出现奇怪的错误。它不再安装任何东西,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42269549/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com