Skip to content

Claude Code Installation Guide (Global npm Install) ​

If you haven't installed Claude Code yet, complete this step first. Once the installation is done, continue with the CC-Switch or Manual Configuration tutorials.

Installation Steps ​

1. First confirm Node.js is installed on your machine ​

Claude Code depends on Node.js. Node.js 18 or later is recommended. Run the following commands in your terminal to check:

bash
node -v
npm -v

2. Install Claude Code globally ​

Run the following command in your terminal to globally install the official Claude Code CLI:

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

Don't use sudo

Do not use sudo npm install -g, otherwise you're likely to run into permission issues later.

3. Verify the Claude Code installation ​

After installation, run the commands below. If the version number prints correctly or the interactive interface opens, the installation succeeded:

bash
claude --version
claude

What's next?

If Claude Code is already installed but not yet connected to NextHub, continue with the CC-Switch tutorial or the Manual Configuration tutorial.

NextHub · Direct connections to OpenAI / Anthropic via official account pools — reliable, secure, and worry-free.