claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[BUG] Can't figure out how to fix permission issues on Mac

Open ndbroadbent opened this issue 9 months ago • 2 comments

Environment

  • Platform (select one):
    • [ X ] Anthropic API
    • [ ] AWS Bedrock
    • [ ] Google Vertex AI
    • [ ] Other:
  • Claude CLI version: 0.2.37
  • Operating System: macOS 15.2
  • Terminal: iTerm2

Bug Description

I've followed the instructions a few times: https://docs.anthropic.com/en/docs/agents-and-tools/claude-code/overview#recommended-create-a-new-user-writable-npm-prefix

But I can't get claude doctor to stop showing a permissions warning:

Enable automatic updates?

Claude Code can't update itself because it doesn't have sufficient permissions.

Please visit our troubleshooting guide...

And the warnings show inside claude code as well.

Here's what I'm running:

$ mkdir -p ~/.npm-global
$ npm config set prefix ~/.npm-global
$ npm install -g @anthropic-ai/claude-code

added 3 packages in 409ms

2 packages are looking for funding
  run `npm fund` for details
Reshimming mise lts...

$ which claude
/Users/ndbroadbent/.npm-global/bin/claude

$ claude doctor

Enable automatic updates?

Claude Code can't update itself because it doesn't have sufficient permissions.

...


$ ls -l /Users/ndbroadbent/.npm-global/bin/claude
lrwxr-xr-x  1 ndbroadbent  staff  52 Mar 12 10:28 /Users/ndbroadbent/.npm-global/bin/claude -> ../lib/node_modules/@anthropic-ai/claude-code/cli.js


$ ls -l /Users/ndbroadbent/.npm-global
total 0
drwxr-xr-x  3 ndbroadbent  staff  96 Mar 12 10:28 bin
drwxr-xr-x  3 ndbroadbent  staff  96 Mar 12 10:28 lib

$  which mise
/Users/ndbroadbent/.local/bin/mise

$ which npm
/Users/ndbroadbent/.local/share/mise/shims/npm

Note that it does work when I run sudo claude doctor:

sudo claude doctor
Password:

 ✓ npm permissions: OK

 Your installation is healthy and ready for auto-updates.

 Press Enter to continue…
$ ls -la ~/.claude.json
-rw-r--r--@ 1 ndbroadbent  staff  77516 Mar 12 10:36 /Users/ndbroadbent/.claude.json

$ ls -la ~/.claude/
total 0
drwxr-xr-x@   3 ndbroadbent  staff    96 Mar 12 10:19 .
drwxr-x---+ 133 ndbroadbent  staff  4256 Mar 12 10:29 ..
drwxr-xr-x@   4 ndbroadbent  staff   128 Mar 12 10:36 statsig

$ ls -la ~/.claude/statsig/
total 16
drwxr-xr-x@ 4 ndbroadbent  staff  128 Mar 12 10:36 .
drwxr-xr-x@ 3 ndbroadbent  staff   96 Mar 12 10:19 ..
-rw-r--r--@ 1 ndbroadbent  staff  105 Mar 12 10:36 statsig.session_id.2656274335
-rw-r--r--@ 1 ndbroadbent  staff   38 Mar  4 15:18 statsig.stable_id.2656274335

What permissions is it checking?

Steps to Reproduce

Not sure how to reproduce on other machines.

Expected Behavior

No permissions error. I'm running claude as my user, it has all the needed permissions.

Actual Behavior

Getting a permissions error

Additional Context

I'm using mise to manage my node and npm versions: https://github.com/jdx/mise Could this be causing the issue?

ndbroadbent avatar Mar 11 '25 21:03 ndbroadbent

I'm having the same issue with latest MacOS beta. I am not using mine however.

travelingflwr avatar Mar 22 '25 16:03 travelingflwr

Also check if BUN_INSTALL environment variable is set and if yes unset it and retry.

felixbuenemann avatar Jun 10 '25 10:06 felixbuenemann

This should be working better in the next release (handling BUN_INSTALL being present).

ant-kurt avatar Sep 10 '25 20:09 ant-kurt

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.

github-actions[bot] avatar Sep 18 '25 14:09 github-actions[bot]