feat: migrate Claude Code installation from npm to native installer#37
feat: migrate Claude Code installation from npm to native installer#37MaEscalanteHe wants to merge 6 commits into
Conversation
Migrate from `npm install -g @anthropic-ai/claude-code` to the native installer at https://claude.ai/install.sh, removing the Node.js dependency entirely. - Remove Node.js install/detection functions - Add curl/bash dependency check - Add Alpine-specific deps (libgcc, libstdc++, ripgrep) - Copy binary to /usr/local/bin/ for multi-user access - Remove installsAfter Node.js dependency from feature metadata
- Remove node:1 feature from test scenarios - Remove node --version and npm --version checks
- Rewrite NOTES.md removing all Node.js references - Add Alpine Linux and deprecation notice sections - Remove Requirements section from README.md
|
@8enmann @chrislloyd Can you check this PR? Thank you |
| install_claude_code() { | ||
| echo "Installing Claude Code CLI..." | ||
| npm install -g @anthropic-ai/claude-code | ||
| curl -fsSL https://claude.ai/install.sh | bash |
There was a problem hiding this comment.
Had problems with that. Changed it to
su - "$_REMOTE_USER" -c 'curl -fsSL https://claude.ai/install.sh | bash'to install it in the correct user
There was a problem hiding this comment.
Done! Implemented the su - "$_REMOTE_USER" approach as you suggested, and updated the binary path resolution to look in the remote user's home instead of root's.
Kept the copy to /usr/local/bin so claude is available globally just in case, but if you'd rather keep it only for the remote user let me know and I'll remove it.
To be able to use the last version of claud code, we need to use for now a customer feature release until this PR is merged anthropics/devcontainer-features#37
|
This PR is super on point, is there a blocker @milamer ? |
FabianSchurig
left a comment
There was a problem hiding this comment.
Hi @8enmann @chrislloyd, the PR looks good to me. We would like to use it, too. Could you accept and merge it, please.
Thanks in advance!
Summary
npm install -g @anthropic-ai/claude-codewith the native installer (https://claude.ai/install.sh), removing the Node.js dependency entirelylibgcc,libstdc++,ripgrep)Motivation
The Claude Code CLI now provides a native installer that does not require Node.js. This simplifies the feature by removing the Node.js dependency, reducing container image size, and eliminating the complex Node.js auto-installation logic.
Test plan
devcontainer features test -f claude-code --skip-autogenerated --skip-duplicated .to verify scenario tests passdevcontainer features test --skip-scenarios -f claude-code -i ubuntu:latest .to verify autogenerated tests passclaude --versionworks inside a built container