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 the folder:

  1. Do this: sudo chown -R $USER ~/.npm
  2. And this: sudo chown -R $USER /usr/local/lib/node_modules
  3. 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.