美文网首页
Mac 安装brew

Mac 安装brew

作者: d4d5907268a9 | 来源:发表于2022-07-05 11:08 被阅读0次

命令行执行下面命令:
/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"

如果安装完

在使用brew 安装scrcpy的时候出现以下问题:

==> Installing dependencies for scrcpy: dav1d, frei0r, bdw-gc, libffi, pkg-config, guile, libtasn1, nettle, p11-kit, libevent, unbound, gnutls, lame, fribidi, pcre, python@3.9, glib, libpthread-stubs, xorgproto, libxau, libxdmcp, libxcb, libx11, libxext, libxrender, lzo, pixman, cairo, gobject-introspection, graphite2, harfbuzz, libass, libbluray, cjson, cmocka, mbedtls, librist, libsoxr, libvidstab, libogg, libvorbis, libvpx, opencore-amr, little-cms2, openjpeg, opus, rav1e, flac, libsndfile, libsamplerate, rubberband, sdl2, snappy, speex, srt, leptonica, libb2, lz4, libarchive, tesseract, theora, x264, x265, xvid, zeromq, zimg, ffmpeg and libusb
==> Installing scrcpy dependency: dav1d
fatal: not in a git directory
Error: Command failed with exit 128: git

经过一番折腾,记录以下解决方式:
通过brew -v命令来查看下是否有以下提示:


image.png
Homebrew 3.4.10-54-g987e688
fatal: unsafe repository ('/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core' is owned by someone else)
To add an exception for this directory, call:

    git config --global --add safe.directory /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core
Homebrew/homebrew-core (no Git repository)
fatal: unsafe repository ('/usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask' is owned by someone else)
To add an exception for this directory, call:

    git config --global --add safe.directory /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask
Homebrew/homebrew-cask (no Git repository)

如果出现以上信息的话,只需要安装上面的提示执行以下命令:

git config --global --add safe.directory /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core

git config --global --add safe.directory /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask

问题找到解决方式之后,就感觉其实很简单。

相关文章

网友评论

      本文标题:Mac 安装brew

      本文链接:https://www.haomeiwen.com/subject/jdfybrtx.html