Working on mac, you might find something the sudo not working as expected or something.
Specially, if you are installing to ‘somehow’ restricted folders like /usr/local/bin ..
Here is what you can do to have an sudo access:
First check the group wheel (mostly) by running the following command
ls -la /private/etc/sudoers
This shall produce something: -r–r—– 1 root wheel 1242 Jun 22 2009 /private/etc/sudoers
This will tell you the sudoers should be in the wheel group
Then check in what group the user currently is using
id
From the listed groups, if wheel is not listed then add it
sudo dscl . -append /Groups/wheel GroupMembership
-_-