更新带有自制软件困境的 nodejs:需要更多权限但 brew 不能与 sudo 一起使用?
Updating nodejs with homebrew dilemma: need more permission but brew doesn't work with sudo?
我正在尝试将 mac 11.6 (20G165)
.
上的节点从 10 更新到 12
我想用自制的方式:
brew upgrade node
然而,在 运行 之后,我得到:
$ brew upgrade node
Error: The following directories are not writable by your user:
/usr/local/share/man/man5
/usr/local/share/man/man7
嗯,那我试了一下sudo方式:
sudo brew upgrade node
Password:
Error: Running Homebrew as root is extremely dangerous and no longer supported.
As Homebrew does not drop privileges on installation you would be giving all
build scripts full access to your system.
我现在应该怎么做才能解决它?
我可以授予
/usr/local/share/man/man5
/usr/local/share/man/man7
我当前用户的目录?这样做有什么风险吗?
我的自制版本:
Homebrew 3.2.17
Homebrew/homebrew-core (git revision 0e79905a9e5; last commit 2021-10-20)
嗯,我有同样的问题,并通过提供的命令解决了它,但随后出现错误。
sudo chown -R $(whoami) /usr/local/share/man/man5 /usr/local/share/man/man7
并确保您的用户具有写入权限。
chmod u+w /usr/local/share/man/man5 /usr/local/share/man/man7
我正在尝试将 mac 11.6 (20G165)
.
我想用自制的方式:
brew upgrade node
然而,在 运行 之后,我得到:
$ brew upgrade node
Error: The following directories are not writable by your user:
/usr/local/share/man/man5
/usr/local/share/man/man7
嗯,那我试了一下sudo方式:
sudo brew upgrade node
Password:
Error: Running Homebrew as root is extremely dangerous and no longer supported.
As Homebrew does not drop privileges on installation you would be giving all
build scripts full access to your system.
我现在应该怎么做才能解决它?
我可以授予
/usr/local/share/man/man5
/usr/local/share/man/man7
我当前用户的目录?这样做有什么风险吗?
我的自制版本:
Homebrew 3.2.17
Homebrew/homebrew-core (git revision 0e79905a9e5; last commit 2021-10-20)
嗯,我有同样的问题,并通过提供的命令解决了它,但随后出现错误。
sudo chown -R $(whoami) /usr/local/share/man/man5 /usr/local/share/man/man7
并确保您的用户具有写入权限。
chmod u+w /usr/local/share/man/man5 /usr/local/share/man/man7