[BUG] native install fails with EINVAL: invalid argument, copyfile '~/.cache/claude/staging/1.0.123/claude' -> ...
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
When installing the native version of claude-code on Ubuntu 22.04.5 I get an error from copyfile.
Apparently, the installation aborts, because when I type the command 'claude' in the terminal, I get "command not found".
I tried to remove all relevant files and directories and try again, but got the same error. Here is the command I used to remove leftovers from a failed install:
rm -rf ~/.cache/claude ~/.local/share/claude ~/.claude*
After manually copying '~/.cache/claude/staging/1.0.123/claude' to '~/bin', I can run 'claude', but 'claude doctor' complains: "Warning: Running native installation but config install method is 'unknown'". Also, this setup will probably fail when claude code tries to update to a new version.
What Should Happen?
Claude Code native should get installed in ~/.local/share/claude and runnable.
Error Messages/Logs
The error message is:
✘ Installation failed
EINVAL: invalid argument, copyfile '/home/user/.cache/claude/staging/1.0.123/claude' -> '/home/user/.local/share/claude/versions/1.0.123.tmp.1129780.1758754356342'
Try running with --force to override checks
Steps to Reproduce
Try to install native Claude Code as suggested in documentation:
curl -fsSL https://claude.ai/install.sh | bash
Claude Model
None
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
1.0.123 (Claude Code)
Platform
Anthropic API
Operating System
Ubuntu/Debian Linux
Terminal/Shell
Xterm
Additional Information
$ claude doctor
Diagnostics
└ Currently running: native (1.0.123)
└ Path: /home/user/bin/claude
└ Invoked: /home/user/claude-bin/claude
└ Config install method: unknown
└ Auto-updates enabled: default (true)
└ Search: OK (bundled)
Warning: Running native installation but config install method is 'unknown'
Fix: Run claude install to update configuration
$ cat /etc/os-release
PRETTY_NAME="Ubuntu 22.04.5 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.5 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
12 Comments
Same problem here:
'/home/XXXX/.local/share/claude/versions/1.0.127.tmp.23967.1758986079378'
I cant find a solution, npm install does also NOT work
I believe I found the issue.
It seems to be this: https://github.com/oven-sh/bun/issues/13968
So it seems to be related to an encrypted home directory.
running
export BUN_CONFIG_DISABLE_COPY_FILE_RANGE=truelets the installation succeedPS: I found the issue using strace. The last call was
copy_file_rangebut the parameters seemed to be right. Glad to have found the issue reported with bun.Yes, my home directory is encrypted with ecryptfs.
Installing with BUN_CONFIG_DISABLE_COPY_FILE_RANGE=true fixed my problem. The latest Claude version installed successfully with no errors or warnings.
Thanks a lot!
Yes, my home directory is indeed encrypted. And yes, @neuron303 your solutions (export ...) works like a charm! Thank you very much. I reported a link to this issues back to support@mail.anthropic.com as I contacted them
I am running Linux Mint 22.2 with an encrypted home directory and had the same issue. Running
export BUN_CONFIG_DISABLE_COPY_FILE_RANGE=truebefore running the native installer worked for me.This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.
The error is still not fixed.
When I try to update Claude Code without
BUN_CONFIG_DISABLE_COPY_FILE_RANGE=trueI get the same error:As I understand it, the problem is that some filesystems don't support the
copy_file_rangesystem call and return EINVAL. Bun uses this syscall during installation (arguably without good reason, since the speed improvement is negligible, if any), which causes the installation to abort. Specifically ecryptfs is known to be problematic: bun: copy_file_range is not supported on eCryptfs.The fix could be either always use "traditional" copy routine instead of
copy_file_range, or retrying with "traditional" copy whencopy_file_rangereturns EINVAL.This issue has been automatically closed due to 60 days of inactivity. If you're still experiencing this issue, please open a new issue with updated information.
wtf?
The autoclose tag was ok for me. But just closing this without notice is dismissive. We should open a new issue with updated information? What is wrong with you? Finding the issue was already 90% work of this bugfix. I am not your contractor. You don't pay me. I won't report anything with you anymore. It's your product and you are not interested in doing the work. Externalizing costs. If somebody else does the work, good for you.
The issue is not fixed, it was updated some 30 days ago (11-Dec-2025). Why it is closed now?
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.