Skip to content

Step 1: Install Node.js

Method 1: Install with nvm (Recommended)

bash
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
source ~/.bashrc
nvm install --lts

Method 2: Debian/Ubuntu

bash
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
sudo apt-get install -y nodejs

NOTE

WSL Users Note

  • Ensure WSL2 is installed (Ubuntu distribution recommended)
  • nvm installation is recommended to avoid permission issues

TIP

Verify installation

bash
node --version
npm --version

Step 2: Install Claude Code

bash
npm install -g @anthropic-ai/claude-code

TIP

Verify Claude Code installation

bash
claude --version

Step 3: Set environment variables

Method 1: Temporary (current session)

bash
export ANTHROPIC_BASE_URL="https://api.bsf.ai"
export ANTHROPIC_AUTH_TOKEN="your_api_key"

Method 2: bash permanent (Recommended)

bash
echo '' >> ~/.bashrc
echo '# API config' >> ~/.bashrc
echo 'export ANTHROPIC_BASE_URL="https://api.bsf.ai"' >> ~/.bashrc
echo 'export ANTHROPIC_AUTH_TOKEN="your_api_key"' >> ~/.bashrc
source ~/.bashrc

Method 3: zsh permanent

bash
echo 'export ANTHROPIC_BASE_URL="https://api.bsf.ai"' >> ~/.zshrc
echo 'export ANTHROPIC_AUTH_TOKEN="your_api_key"' >> ~/.zshrc
source ~/.zshrc

TIP

Verify environment variables

bash
echo $ANTHROPIC_BASE_URL
echo $ANTHROPIC_AUTH_TOKEN

Step 4: Start using

bash
claude

FAQ

Issue: npm permission error (EACCES)
bash
mkdir ~/.npm-global
npm config set prefix '~/.npm-global'
echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.bashrc
source ~/.bashrc
npm install -g @anthropic-ai/claude-code
Issue: Accessing Windows files in WSL
bash
# Windows filesystem is mounted at /mnt/
cd /mnt/c/Users/YourName/

# Working in WSL native filesystem is recommended
cd ~