Michael.blog

How to unfuck permissions

When working with npm (Node Package Manager), I picked up the horrible habit of throwing a sudo in front of npm install or npm up. Usually, I only did it when I got an error. This is bad. It becomes a headache at some point.

Here’s how to unfuck the permissions of any folder:

  1. Do this: sudo chown -R $USER ~/.npm (you’ll want to change~/.npm to the directory with permissions issues.
  2. And, if you get an error, maybe do the sudo chown -R $USER bit on the folder in question.

chown -R $USER simply changes the ownership to the user recursively to all the stuff in the folder.

Speak your mind

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: