[英]Build failed with NonZeroExit 77 when installing Haskell on Mac, ghcup --cache install" failed
[英]ghcup install: Permission denied when writing to ~/.ghcup/cache directory
我正在尝试在 Ubuntu 上安装 ghcup:
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh
使用默认选项(添加到.bashrc,不要安装 HLS,不要安装 Stack)。
问题是当脚本尝试将ghcup-0.0.6.yaml.tmp
文件写入~/.ghcup/cache
目录时,我收到一个permission denied
错误,我不知道为什么。
该目录的权限为 1775 (drwxrwxr-x)。 将它们升级到 1777 (drwxrwxrwt) 并重新运行 curl 命令会产生相同的错误。 目录所有者是我(不是 root),我按照 ghcup 安装说明运行不带sudo
的 curl 命令。
完整命令 output:
Dload Upload Total Spent Left Speed
100 24.3M 100 24.3M 0 0 5782k 0 0:00:04 0:00:04 --:--:-- 5783k
[ Info ] downloading: https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-0.0.6.yaml as file /home/austin/.ghcup/cache/ghcup-0.0.6.yaml
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0Warning: Failed to create the file
Warning: /home/austin/.ghcup/cache/ghcup-0.0.6.yaml.tmp: Permission denied
0 134k 0 858 0 0 8429 0 0:00:16 --:--:-- 0:00:16 8495
curl: (23) Failure writing output to destination
[ Warn ] Could not get download info, trying cached version (this may not be recent!)
[ ... ] If this problem persists, consider switching downloader via:
[ ... ] ghcup config set downloader Wget
[ Error ] JSON decoding failed with: YAML exception:
[ ... ] Yaml file not found: /home/austin/.ghcup/cache/ghcup-0.0.6.yaml
[ ... ] Consider removing /home/austin/.ghcup/cache/ghcup-0.0.6.yaml manually.
[ ... ]
"_eghcup upgrade" failed!
希望能解释发生了什么以及如何解决它,这样我就可以开始学习 Haskell。 提前致谢。
解决了:
原来 curl 的snap
版本是半损坏的。 运行后我得到了成功的ghcup
安装:
sudo snap remove curl
sudo apt install curl
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.