node.js - 使用自制程序更新 nodejs 困境:需要更多权限但 brew 不适用于 sudo?
问题描述
我正在尝试将我的 mac 上的节点从 10 更新到 12 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
推荐阅读
- excel - 刮掉一个彭博网站,让市值达到卓越水平
- c++ - 没有数据成员的C++派生类的问题
- acumatica - 在 acumatica 版本 4. 10 上发布新的自定义项目时缺少字段
- python - 有没有办法自动化 Atlassian Bamboo 计划创建和配置过程
- c# - 在多个函数中共享单个 SQL 连接(不公开)
- amazon-web-services - 为新客户自动部署 AWS
- ios - iOS 动画 UITabBarController 滑动;查看重叠状态栏 - 仅在首次加载时
- json - 我无法在颤动中将复杂的 json 数据发送到列表视图
- c++ - 如何序列化/反序列化协议缓冲区中的单个(独立)重复字段?
- python - Gradle/Kotlin 相当于 Python 的 Invoke