Appearance
Install Node.js on Windows
Node.js is required for running tools like CodeX CLI, Gemini CLI, and CC-Switch.
Method 1: Official Installer (Recommended)
- Visit the official Node.js website: https://nodejs.org
- Download the LTS (Long Term Support) version for Windows
- Run the installer (
.msifile) - Follow the installation wizard:
- Accept the license agreement
- Keep the default installation path
- Ensure "Add to PATH" is checked
- Click Install and wait for completion
Verify Installation
Open a new PowerShell or Command Prompt window and run:
powershell
node -v
npm -vYou should see version numbers like v22.x.x and 10.x.x.
Method 2: Using fnm (Fast Node Manager)
fnm lets you install and switch between multiple Node.js versions easily.
Install fnm
powershell
winget install Schniz.fnmInstall Node.js via fnm
powershell
fnm install --lts
fnm use lts-latest
fnm default lts-latestAdd fnm to Your Shell Profile
Add the following to your PowerShell profile ($PROFILE):
powershell
fnm env --use-on-cd --shell powershell | Out-String | Invoke-ExpressionMethod 3: Using nvm-windows
- Download nvm-windows installer
- Run the installer
- Open a new terminal and install Node.js:
powershell
nvm install lts
nvm use ltsTroubleshooting
node is not recognized
- Close and reopen your terminal after installation
- Ensure Node.js was added to PATH during installation
- Try restarting your computer
Permission Issues
If you encounter permission errors with npm install -g:
powershell
# Run PowerShell as Administrator
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser