Skip to content

Install Node.js on Linux ​

Required runtime for the three main AI coding tools.

Important

Claude Code, CodeX, and Gemini CLI all require Node.js 18+. If Node.js 18 or later is already installed, you can skip this page. Check with node -v.

Ubuntu/Debian ​

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

# Verify installation
node --version
npm --version

CentOS/RHEL ​

bash
curl -fsSL https://rpm.nodesource.com/setup_lts.x | sudo bash -
sudo yum install -y nodejs

# Verify installation
node --version
npm --version

Fedora ​

bash
sudo dnf install -y nodejs npm

# Verify installation
node --version
npm --version

Arch Linux ​

bash
sudo pacman -S nodejs npm

# Verify installation
node --version
npm --version

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 shell configuration
source ~/.bashrc

# Install Node.js LTS
nvm install --lts

# Set default version
nvm use --lts
nvm alias default node

FAQ ​

Permission Issues ​

If you encounter permission problems, configure npm to use a user-level directory:

bash
mkdir ~/.npm-global
npm config set prefix '~/.npm-global'
echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.bashrc
source ~/.bashrc

Node.js Version Is Too Old ​

If your distribution-provided Node.js is too old, use the NodeSource repository or nvm to install the latest LTS version.

Next Steps ​

Environment Ready

You can now install Claude Code, CodeX, or Gemini CLI.

Friendly, practical, and reliable AI coding support