【Haskell】stack环境遇到的版本过低问题和网络问题


我在刚想接触haskell,找到课程资源在搭环境时遇到了stack版本过低网络的问题(貌似)。

stack版本过低

这个在课程资源的README.md里有讲,表现为类似于下面这行的错误。

Downloading lts-18.18 build plan ... RedownloadInvalidResponse
# 按理来说更新就好
stack upgrade

但是,我那个时候也是网络有问题,最后其实是自己在github上下下来,然后解压安装的……

网络

据Polar学长所说,应该要挂代理,但是我其实已经挂了,而且也尝试过按照Install/upgrade - The Haskell Tool Stack (haskellstack.org)以及其他很多文档说的,所说的挂上国内Thu的源,但是都不行。

最后,偶然直接搜Thu的stackage软件仓库源,发现上面找的文档不好用的原因,大概是stack版本更新,config.yaml的写法换了导致的,最终愉快地解决了。

vim ~/.stack/config.yaml

# 在最后加上
setup-info-locations: ["https://mirrors.tuna.tsinghua.edu.cn/stackage/stack-setup.yaml"]
urls:
  latest-snapshot: https://mirrors.tuna.tsinghua.edu.cn/stackage/snapshots.json

snapshot-location-base: https://mirrors.tuna.tsinghua.edu.cn/stackage/stackage-snapshots/

声明:残城三梦|版权所有,违者必究|如未注明,均为原创|本网站采用BY-NC-SA协议进行授权

转载:转载请注明原文链接 - 【Haskell】stack环境遇到的版本过低问题和网络问题


Live In Fly && Live Infinitely