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
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
- Do not use sudo. Anthropic's article says so directly.
- 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. - Option B: give npm a folder you own. Run
npm config set prefix ~/.npm-global, then add that folder'sbindirectory to your PATH, for example by addingexport PATH=~/.npm-global/bin:$PATHto your~/.zshrcor~/.bashrc. Open a new terminal and install again. - Check your Node version with
node -v. If it is older than 18, update it (Anthropic suggestsnvm install --lts) or use the native installer. - Check the install by running
claude doctorin a normal terminal, not inside a Claude session. - If the terminal says
claude: command not foundright after installing, open a new terminal or runsource ~/.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
Describe it
Tell us what you need in plain words. You don't have to be technical or have an account to start.
-
2
Free 15-minute call
A verified developer calls you. Many tasks are sorted right there, and it costs nothing.
-
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.
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 helpQuestions
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.