我尝试尝试尝试在一个新的网站使用Hugo,我在安装过程中卡住了。我已经安装了Homebrew,当运行该版本时,我得到以下:
~ % brew --version
Homebrew 2.7.2
Homebrew/homebrew-core (no git repository)
Homebrew/homebrew-cask (git revision b96680c; last commit 2021-01-07)
当我运行brew install hugo
时
我得到了以下结果:
~ % brew install hugo
fatal: Could not resolve HEAD to a revision
==> Searching for similarly named formulae...
Error: No similarly named formulae found.
Error: No available formula or cask with the name "hugo".
==> Searching for a previously deleted formula (in the last month)...
Error: No previously deleted formula found.
==> Searching taps on GitHub...
Error: No formulae found in taps.
我做错什么了?这是我第一次自己酿啤酒。
编辑:当运行brew install --verbose Hugo
时,我得到以下警告:
% brew install --verbose hugo
fatal: Could not resolve HEAD to a revision
==> Searching for similarly named formulae...
Error: No similarly named formulae found.
Error: No available formula or cask with the name "hugo".
==> Searching for a previously deleted formula (in the last month)...
Error: No previously deleted formula found.
==> Searching taps on GitHub...
/usr/bin/curl --disable --globoff --show-error --user-agent Homebrew/2.7.2\ \(Macintosh\;\ Intel\ Mac\ OS\ X\ 11.1\)\ curl/7.64.1 --header Accept-Language:\ en --retry 3 --location https://api.github.com/search/code\?q=user\%3AHomebrew\+path\%3AFormula\+path\%3ACasks\+path\%3A.\+filename\%3Ahugo\+extension\%3Arb\&per_page=100 --header Accept:\ application/vnd.github.v3\+json --write-out '
'\%\{http_code\} --header Accept:\ application/vnd.github.antiope-preview\+json --header Authorization:\ token\ ****** --dump-header /private/tmp/github_api_headers20210106-8376-1r02uaz
5条答案
按热度按时间wh6knrhe1#
用途
或
hfyxw5xn2#
如this thread所示,这可能与
brew
本身有关,而与hugo
无关。这应该会给予你更多,让你看到在哪一步brew是卡住了。
[错误发生的地方],我换到那个目录,发现它是空的-目录中只有一个
.git/
文件夹,没有其他东西。因此,为了恢复丢失的内容,我使用了
git fetch
和git pull --rebase
。这就指向了brew配置问题,因为hugo有一个formulae
软件包根据其公式安装,公式位于
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula
中检查该
Formula
文件夹,查看其中是否缺少hugo
。如果没有,至少在a new tap中尝试
brew extract hugo
。qfe3c7zg3#
通过运行以下两个命令设置核心
1.自制/核心
nzkunb0c4#
我得到了同样的错误。我尝试了上面的大多数解决方案。最后这些步骤有帮助:
卸载自制程序
第一个月
手动删除此文件和两个文件夹
/usr/local/com.apple.installer.keep
/usr/local/Homebrew
/usr/var/homebrew
再次安装自制程序
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
px9o7tmv5#
运行
brew doctor
并且输出:
按照警告下的指示去做,一切似乎都解决了。