Create amazing web applications!

NPM Install - Resolving EACCES Permissions Denied

How to resolve eacces permissions denied when installing npm packages globally. Here's how you solve this issue in a couple of minutes.

by Anthony Pillos 1 minute

npmtips and trickseaccesspermission denied

Typically when installing a new npm packages globally in your system, you will encounter an error something like Error: EACCESS permission denied something.

Don't worry, it's natural I'm here to help you to fix this kind of error.

To the Rescue

Normally I'm using node version manager (nvm) to handle my node versions, so I can easily switch to any version I prefer but we will not discuss it here. I'll create a separate blog post for that on how to set up a multiple node version using NVM (node version manager).

So let's take a look the error that most probably something like this below:


npm ERR! Error: EACCES, open '/Users/letscodepare/.npm/-/all/.cache.json'
npm ERR!  { [Error: EACCES, open '/Users/letscodepare/.npm/-/all/.cache.json']
npm ERR!   errno: 3,
npm ERR!   code: 'EACCES',
npm ERR!   path: '/Users/letscodepare/.npm/-/all/.cache.json' }
npm ERR! Please try running this command again as root/Administrator.


  1. Open up your favorite terminal and run this code
sudo chown -R $(whoami) ~/.npm

So what does it do? To the Rescue

chown is a unix command which means "change owner". From that definition based on our code above we are going to change the owner of our folder ~/.npm which for sure the "root" user is applied.

We're going to assign this folder recursively to our own username using this command whoami so that it will be easy to read and write anything we want.

NOTE: Somehow, even when we change the owner of ~/.npm folder, we still encounter an EACCES error. To Fix that, we should change the owner of our node_modules folder.

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


Now you can finally install npm packages without sudo.

Wait just wait

Next Featured

Explore our new Tips and Tricks tutorial. Explore our Tips and Tricks


I hope you enjoy our tutorial, Let me know incase you encounter any error I would love to answer that. Don't forget to subscribe to my Youtube Channel at Let's Code Pare - Youtube Channel

Buy Me A Coffee

Share Now

Want to get more 🔥 tips like this one?

Subscribe to get notified for our new dev tutorials

Let's Code Pare
Let's Code Pare Youtube Channel