Last active
August 6, 2025 22:00
-
-
Save paulsheldrake/c53ba6f4c7659e3b12165ac635d7813a to your computer and use it in GitHub Desktop.
Install Claude code locally
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Exit immediately if any command fails | |
set -e | |
echo "π§ Installing NVM..." | |
# Download and install NVM | |
export NVM_DIR="$HOME/.nvm" | |
if [ -d "$NVM_DIR" ]; then | |
echo "β οΈ NVM is already installed." | |
else | |
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash | |
fi | |
# Load NVM (necessary in non-login scripts) | |
export NVM_DIR="$HOME/.nvm" | |
# shellcheck disable=SC1090 | |
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" | |
echo "β NVM installed." | |
echo "π¦ Installing latest LTS version of Node.js..." | |
nvm install --lts | |
nvm use --lts | |
nvm alias default 'lts/*' | |
echo "β Node.js LTS installed: $(node -v)" | |
echo "π Installing 'claude-code' globally via npm..." | |
npm install -g @anthropic-ai/claude-code | |
echo "π All done! 'claude-code' installed globally." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment