This Claude tutorial focuses specifically on Claude Code: from installation and verification to binding an API Key, and then troubleshooting common errors. Follow the steps and you can get Claude Code running in your terminal within 10 minutes, using it for code generation, bug fixing, and simple development collaboration.
1. Pre-installation prep: Don’t get tripped up by the Node.js version
Claude Code depends on a Node.js environment. It’s recommended to install Node.js 18 or above first, then open a new terminal window. Windows users can just run the installer and keep clicking Next; on macOS, you can install via the official installer package or a package manager. After installation, type node -v in the terminal to confirm the version is correct.
2. Install Claude Code: Global npm install and China mirror
Run the global installation command in the terminal: npm install -g @anthropic-ai/claude-code. This is the most common way to install Claude Code. If your network is slow when accessing the official npm registry, you can switch to a mirror: npm install -g @anthropic-ai/claude-code --registry=https://registry.npmmirror.com. After installation, reopen the terminal and enter claude --version to verify that Claude Code is available.


