Claude Codegeneral

Permission Denied (EACCES) When Installing Claude Code

npm install of Claude Code fails with EACCES or permission denied? Don't use sudo: use the native installer or give npm a folder you own. Exact commands inside.

2 min read Updated Applies to Claude Code

What is going on

You tried to install Claude Code with npm and the install stopped with EACCES or "permission denied". This guide follows Anthropic's troubleshooting article for installation. It says this error usually means the install was run with sudo, or that your global npm folder is owned by the root user. We are not affiliated with Anthropic.

The short answer: do not use sudo. Use the native installer, or point npm at a folder you own.

Error messages you might see

EACCES: permission denied

Common causes

  • An earlier install run with sudo — it can leave files owned by the root user, which later installs cannot change
  • A global npm folder owned by root — npm cannot write there as your own user
  • An old version of Node — Anthropic's article says Claude Code needs Node 18 or later

How to fix it

  1. Do not use sudo. Anthropic's article says so directly.
  2. Option A: the native installer. Run curl -fsSL https://claude.ai/install.sh | bash. Anthropic says it bundles its own runtime, so your Node version does not matter.
  3. Option B: give npm a folder you own. Run npm config set prefix ~/.npm-global, then add that folder's bin directory to your PATH, for example by adding export PATH=~/.npm-global/bin:$PATH to your ~/.zshrc or ~/.bashrc. Open a new terminal and install again.
  4. Check your Node version with node -v. If it is older than 18, update it (Anthropic suggests nvm install --lts) or use the native installer.
  5. Check the install by running claude doctor in a normal terminal, not inside a Claude session.
  6. If the terminal says claude: command not found right after installing, open a new terminal or run source ~/.zshrc (or ~/.bashrc). See command not found after installing Claude Code.

Getting help takes about a minute

No hiring, no back and forth. A real person looks at your app.

  1. 1

    Describe it

    Tell us what you need in plain words. You don't have to be technical or have an account to start.

  2. 2

    Free 15-minute call

    A verified developer calls you. Many tasks are sorted right there, and it costs nothing.

  3. 3

    Pay after you approve

    If there is more to do, you get one fixed price up front. You pay only once you are happy.

Get help

Real people, reviewed by hand

Developers who do this every day

Every developer is approved by our team before they can take a task. Describe yours and the first one who is free picks it up.

Get help

Questions

Can I just use sudo?

Anthropic's article says not to. Installing with sudo is a usual cause of this error.

Do I need to install anything for Claude Desktop?

Anthropic's article says there is nothing to install in Claude Desktop.

The terminal says "command not found" after a successful install. Is that the same problem?

No. That means your terminal has not picked up the new PATH yet. Open a new terminal, or see our guide on command not found.

Keep reading

Can't fix it yourself?
Real developers can help.

Get help