8000 feat: claude-code workspace persistence by DevelopmentCats · Pull Request #154 · coder/registry · GitHub
[go: up one dir, main page]

Skip to content

feat: claude-code workspace persistence #154

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
Jun 19, 2025
Merged
Changes from 1 commit
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat: enhance Claude Code installation process with npm check includi…
…ng new node install via nvm if not present
  • Loading branch information
DevelopmentCats committed Jun 13, 2025
commit 54b97374b40a176f63bd260b7bdfeecd8e385cd9
27 changes: 25 additions & 2 deletions registry/coder/modules/claude-code/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,32 @@ resource "coder_script" "claude_code" {

# Install Claude Code if enabled
if [ "${var.install_claude_code}" = "true" ]; then
# Check if npm is available, if not try to install Node.js using NVM
if ! command_exists npm; then
echo "Error: npm is not installed. Please install Node.js and npm first."
exit 1
echo "npm not found, checking for Node.js installation..."
if ! command_exists node; then
echo "Node.js not found, installing Node.js via NVM..."
# Install NVM
export NVM_DIR="$HOME/.nvm"
if [ ! -d "$NVM_DIR" ]; then
mkdir -p "$NVM_DIR"
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
else
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
fi

# Install Node.js LTS version
nvm install --lts
nvm use --lts
nvm alias default node

echo "Node.js installed: $(node --version)"
echo "npm installed: $(npm --version)"
else
echo "Node.js is installed but npm is not available. Please install npm manually."
exit 1
fi
fi
echo "Installing Claude Code..."
npm install -g @anthropic-ai/claude-code@${var.claude_code_version}
Expand Down
0