Omniscio

OmniscioGuidesEACCES: permission denied

Cannot install Claude Code: EACCES permission denied

Last checked against Anthropic's documentation on November 18, 2026. By the Omniscio team. Updated .

What is the exact message?

EACCES: permission denied

Anthropic's installation troubleshooting page lists it as the exact error for an install that cannot write, and sends it to its permission section rather than to any of the network or binary causes.

What does it mean?

The operating system refused a write the install needed. It is not a download problem and not an account problem: the command reached your disk and your disk said no.

Which path it names matters, because the fix is to make that path writable rather than to run everything as an administrator.

Where Claude Code writes

On macOS and Linux, Anthropic lists these locations for the install:

  • ~/.claude/downloads/, where the install command puts the downloaded binary.
  • ~/.local/bin/, which holds the claude launcher.
  • ~/.local/share/claude/, each version it downloads.
  • ~/.local/state/claude/, its lock files, and ~/.cache/claude/, staged downloads.
  • ~/.claude.json, the global config file where the installer records the install method.

If you set XDG_DATA_HOME, XDG_STATE_HOME or XDG_CACHE_HOME, the install uses those instead of ~/.local/share, ~/.local/state and ~/.cache. CLAUDE_CONFIG_DIR moves the config file.

How do I fix it?

Anthropic adds a Windows note first: the install writes under %USERPROFILE%, which your user can write by default, so this rarely applies there.

  1. Test the two directories Anthropic names. Run test -w ~/.local/bin && echo "writable" || echo "not writable" and the same line for ~/.claude. A not writable answer is the fault.
  2. Give your user the directory. Anthropic's commands are sudo mkdir -p ~/.local/bin followed by sudo chown -R $(whoami) ~/.local.
  3. On npm, change installer instead of adding sudo. Anthropic says: if it fails with EACCES, switch to the native installer rather than rerunning it with sudo, because Claude Code runs npm without sudo when it updates itself, so automatic updates would fail the same way. The native installer's command is curl -fsSL https://claude.ai/install.sh | bash.

How do I know it worked?

  • The install finishes without repeating EACCES: permission denied.
  • claude --version prints a version number, which is how Anthropic's own troubleshooting page confirms an install.
  • The directories answer writable when you run the two test -w lines again.

Where these answers come from

  • The message, its place in the error table, the install locations, the writability tests and the ownership commands: Anthropic's installation troubleshooting, read November 18, 2026.
  • The switch to the native installer, and the reason not to use sudo: the same page's permission and npm sections, read November 18, 2026.
  • The native installer command: Set up Claude Code, read November 18, 2026.

Common questions

Will sudo fix it for good?

Anthropic's answer for npm is a different installer, not a higher privilege: Claude Code runs npm without sudo when it updates itself, so an install made with sudo would fail the same way at its next automatic update.

Does this happen on Windows?

Rarely, in Anthropic's words: the Windows install writes under %USERPROFILE%, which your user can write to by default. If it does appear, the path on your line is still the one that refused the write; either make that path writable or move to the native installer.

My error names a different path than the ones here. Is it still EACCES?

Yes. The message says a write was refused; the path on your line is the one to make writable, and Anthropic's rule is the same for it.

Does this touch my API key or my login?

No. It is a filesystem permission, so nothing about the account is involved, and no sign-in step is needed after the fix.