我如何摆脱 sudo 要求?

How do i get rid of the sudo requirement?

我正在使用 MacOS Catelina,我经常需要 运行 我的终端使用 sudo 否则它们会失败。就像当我使用 Visual Studio 和 IONIC 向全局添加内容或当它尝试创建目录等时。 有没有办法在没有 sudo 的情况下将登录用户更改为 运行 提升的命令?

您要么继续使用 sudo,要么将当前用户切换为 root(这不是推荐的方式)

The user account named ”root” is a superuser with read and write privileges to more areas of the system, including files in other macOS user accounts. The root user is disabled by default. If you can log in to your Mac with an administrator account, you can enable the root user, then log in as the root user to complete your task.

The root user account is not intended for routine use. Its privileges allow changes to files that are required by your Mac. To undo such changes, you might need to reinstall your system software. You should disable the root user after completing your task.

在终端中使用 sudo 命令比启用 根用户。要了解 sudo,请打开终端应用程序并输入 man 须藤。

取自https://support.apple.com/en-us/HT204012