Recently I had to bring up a dev environment, I'm using Ubuntu via VirtualBox. I needed to fix my NPM permissions and followed the npm guide.
I ran option 1, without paying attention to the warning. Ouch, sudo permissions were hosed. Fortunately, it was not too difficult to get back up and running, a bit of googling.
What worked for me (Ubuntu 17.04) was restarting, hold escape, from grub menu go into recovery mode and drop to terminal. Then ran:
chown root:root /usr/bin/sudo && chmod 4755 /usr/bin/sudo