VibeDict

📦No permission, so install failed (EACCES)

What you'll see
npm ERR! Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules'

Installing stopped because you don't have permission to write files in that folder. It mostly happens with global (-g) installs.

🤔 Why does it happen?

  • You tried to install into a computer-wide folder (npm install -g)
  • Something was installed with sudo before, so the folder's owner changed

🔧 Try this

  1. Avoid adding sudo, since it can make the problem bigger
  2. Reinstalling Node with a Node version manager like nvm fixes it most of the time

🤖 Ask your AI like this

I get the EACCES permission error below when installing with npm. My computer is [Mac/Windows]. Please tell me step by step how to fix it safely without sudo. [Paste the full error here]

Replace the [ ] parts with your own situation, and paste the error with a few extra lines before and after it.

Related terms

Other errors in this group