Skip to content

Instantly share code, notes, and snippets.

@chasevida
Last active October 29, 2015 19:35
Show Gist options
  • Save chasevida/3fef7ded97a9403a1290 to your computer and use it in GitHub Desktop.
Save chasevida/3fef7ded97a9403a1290 to your computer and use it in GitHub Desktop.
Resolving Permission Errors - /usr/local and ~/.local

When getting up and running with a new machine I often run into this issue and completely forget why on earth it's happening. This StackOverflow post gives the overview of the issue and solution.

Essentially on a default installation this folder is owned by root and missing the appropriate permissions for your user. So the commands in usr/local/bin only work when used with sudo. To resolve this we can take ownership of /usr/local by running the following:

$ sudo chown -R $(whoami) /usr/local

$ sudo chown -R $(whoami) ~/.local

That second command is helpful for npm packages making use of the .local folder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment