繁体   English   中英

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

[英]weird error with haskell-stack. it doesn't install anything anymore

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

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"

stack --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

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

编辑

Stack.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 wget -qO- https://get.haskellstack.org/ | sh它没有用,因为我在/usr/bin/堆栈,我删除了堆栈,然后再次尝试wget -qO- https://get.haskellstack.org/ | sh 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 ,它会工作:)

我被同样的问题阻止,除非我检查which stack (或使用where stack作为替代)并且我发现我使用的是旧版本的堆栈,我以某种方式安装,并且当我输入时从未访问过新版本stack命令...

这是我意识到问题的情况.. 该堆栈版本-问题

如果你检查stack --version并获得类似Version 0.1.10.0 x86_64 ,那么它远离当前版本,我正在使用的当前版本(回答此问题时)是Version 1.3.3, Git revision 078cfadeb37a39501eae24732e5c757cc8aca31b x86_64 hpack-0.17.0

如果你确认你没有使用错误的一个堆栈,但堆栈版本仍然太低,你可以使用stack upgrade --git将你的堆栈从git升级到最新版本(注意这将需要一段时间) 。

希望这有用。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM