Installing Node.js on Linux
The runtime required by all three AI coding tools
💡 Important
Claude Code, CodeX, and Gemini CLI all require Node.js 18+ to run. If you already have Node.js 18 or higher installed, you can skip this section. Verify with: node -v
Ubuntu/Debian
Using the NodeSource repository (recommended)
bash
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
sudo apt-get install -y nodejs
# Verify the installation
node --version
npm --versionCentOS/RHEL
bash
curl -fsSL https://rpm.nodesource.com/setup_lts.x | sudo bash -
sudo yum install -y nodejs
# Verify the installation
node --version
npm --versionFedora
bash
sudo dnf install -y nodejs npm
# Verify the installation
node --version
npm --versionArch Linux
bash
sudo pacman -S nodejs npm
# Verify the installation
node --version
npm --versionUsing nvm (recommended for power users)
nvm lets you manage multiple Node.js versions:
bash
# Install nvm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
# Reload the shell configuration
source ~/.bashrc
# Install the Node.js LTS release
nvm install --lts
# Set it as the default version
nvm use --lts
nvm alias default nodeTroubleshooting
Permission issues
If you hit permission issues, configure npm to use a directory in your home folder:
bash
mkdir ~/.npm-global
npm config set prefix '~/.npm-global'
echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.bashrc
source ~/.bashrcVersion too old
If your distro ships an outdated Node.js, install the latest LTS via the NodeSource repository or nvm.
Next steps
✅ Environment ready!
You're now set to install Claude Code, CodeX, or Gemini CLI.