Skip to content

feat: migrate Claude Code installation from npm to native installer#37

Open
MaEscalanteHe wants to merge 6 commits into
anthropics:mainfrom
MaEscalanteHe:feat/native-installer
Open

feat: migrate Claude Code installation from npm to native installer#37
MaEscalanteHe wants to merge 6 commits into
anthropics:mainfrom
MaEscalanteHe:feat/native-installer

Conversation

@MaEscalanteHe
Copy link
Copy Markdown

Summary

  • Replace npm install -g @anthropic-ai/claude-code with the native installer (https://claude.ai/install.sh), removing the Node.js dependency entirely
  • Add Alpine Linux support with required dependencies (libgcc, libstdc++, ripgrep)
  • Remove Node.js references from tests, scenarios, and documentation

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

  • Run devcontainer features test -f claude-code --skip-autogenerated --skip-duplicated . to verify scenario tests pass
  • Run devcontainer features test --skip-scenarios -f claude-code -i ubuntu:latest . to verify autogenerated tests pass
  • Verify claude --version works inside a built container

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
@AlbanDurrheimer
Copy link
Copy Markdown

@8enmann @chrislloyd Can you check this PR? Thank you

Comment thread src/claude-code/install.sh Outdated
install_claude_code() {
echo "Installing Claude Code CLI..."
npm install -g @anthropic-ai/claude-code
curl -fsSL https://claude.ai/install.sh | bash
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@MaEscalanteHe MaEscalanteHe requested a review from milamer April 9, 2026 19:16
clamoriniere added a commit to DataDog/datadog-operator that referenced this pull request Apr 9, 2026
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
@marceloceccon
Copy link
Copy Markdown

This PR is super on point, is there a blocker @milamer ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants