The solution to the error of / etc / sudoers: syntax error in sudoer file under mac

In recent days, I tried to configure sudo for passwordless operation, which smashed the sudoers file and reported the following error

/etc/sudoers: syntax error near line 59 <<<
sudo: parse error in /etc/sudoers near line 59
sudo: no valid sudoers sources found, quitting
sudo: unable to initialize policy plugin

Search the Internet and jot down solutions

pkexec visudo

pkexec function is to execute the command as root, it doesn't seem to work on MAC, but ~ ~, I will update the solution later
MAC solution:
open /etc directory with folder, right-click -> Show introduction

Undid the bottom right?”, and then change the everyone permission to read and write to be able to modify the sudoers file freely

Read More: