Featured image of post Install Claude Code and Connect DeepSeek (Beginner-Friendly Guide)

Install Claude Code and Connect DeepSeek (Beginner-Friendly Guide)

Overview

Who Is This Tutorial For?

This tutorial is for users with no computer background at all. You don’t need to know what a “command line” is, what “environment variables” are, or what “version management” is — I will break down every step to the finest detail, telling you where to click, what to click, what to type, and what you should see to know it worked.

What Are We Installing? Why Do We Need These?

Before we start, let’s understand the 3 things we need to install and what each one does:

# Software One-Line Explanation Why It’s Required
1 Node.js The “engine” that lets your computer run JavaScript programs Claude Code is written in JavaScript and won’t run without it
2 Claude Code An AI programming assistant that lives in your computer’s terminal This is what we ultimately want to use
3 CC-Switch A small tool to “swap the brain” of Claude Code Switches Claude Code from the expensive official model to the affordable DeepSeek

The whole process takes about 10-15 minutes. Please follow the steps in order — don’t skip around.

📌 Prerequisites

You need a Windows computer (Windows 10/11) with a working internet connection.


Install Node.js

What is Node.js?

Node.js = the runtime environment that lets your computer run Claude Code. It’s completely free. Just like you need Windows installed before you can run software, you need Node.js installed before you can run Claude Code.

Download Node.js

Step 1: Open Your Browser

Open any browser on your computer (Chrome, Edge, or Firefox).

Step 2: Visit the Node.js Official Website

Type the following URL into the browser’s address bar (the long bar at the top where you enter web addresses) and press Enter:

1
https://nodejs.org/

Step 3: Find the Download Button

Once the page loads, you’ll see two large buttons in the center:

  • The left button says LTS (with a recommended version number, e.g., 22.16.0 LTS)
  • The right button says Current

Click the left LTS button — your browser will automatically start downloading a .msi file.

Step 4: Find the Downloaded File

Once the download completes (usually just a few seconds), there are two ways to find the file:

  • Method 1: Click the download list in the top-right corner of your browser (usually a downward arrow ↓ icon) and find the file you just downloaded — the filename will be something like node-v22.16.0-x64.msi
  • Method 2: Open File Explorer (the window you use to browse folders), find the Downloads folder in the left sidebar, and the file will be inside

Install Node.js

Step 1: Double-click the Installer

In the Downloads folder, find node-v22.16.0-x64.msi (the version number may differ slightly) and double-click it.

Step 2: Welcome Screen

A window titled Node.js Setup will appear. Click the Next button at the bottom.

Step 3: License Agreement

The window displays a long block of English license text.

  • Check the box in the bottom-left corner: I accept the terms in the License Agreement
  • Click Next

Step 4: Installation Location (⚠️ Important! You Need to Change the Path)

This shows where Node.js will be installed on your computer.

The default path is: C:\Program Files\nodejs\

📌 Move It to the D Drive!

It’s recommended to install to the D drive because:

  • The C drive is your system drive — putting too much on it slows down your computer
  • The D drive is for software — if you ever need to reinstall Windows, everything on D stays safe
  • It’s easier to manage and find things

Steps to change:

  1. Click inside the path input box, select everything (press Ctrl + A), then delete it
  2. Type the new path:
    1
    
    D:\nodejs\
    
  3. Click Next
💡 Note

Make sure the path has no Chinese characters or spaces, or the installation may fail.

Step 5: Custom Setup

A page with a tree-like checkbox list appears (Custom Setup).

Don’t change anything — just click Next.

Step 6: Confirm Installation

Click the Install button. If a security prompt appears, click Yes.

Step 7: Wait for Installation

The progress bar will complete — usually takes just 10-30 seconds.

Step 8: Finish

Click Finish.

Node.js Installation Complete!

Both Node.js and npm (Node.js’s package manager — think of it as an “app store”) are now installed.

Verify Node.js Is Installed Correctly

After installation, we need to verify everything — like checking your groceries to make sure nothing’s missing.

Step 1: Open Command Prompt (CMD)

What is “Command Prompt”?

Command Prompt (also called CMD) is a black window with white text where you can type text commands to make your computer do things. You’ll use it often going forward.

How to open it (choose one):

  • Method 1 (Recommended):

    1. Hold down the Win key on your keyboard (bottom-left corner, the key with the Windows logo)
    2. While holding it, press the R key
    3. A small window titled “Run” will pop up — type cmd in it
    4. Click OK or press Enter
  • Method 2:

    1. Click the Start menu in the bottom-left corner of your desktop (Windows icon)
    2. Type cmd in the search box
    3. Click Command Prompt in the search results

Step 2: Enter Verification Commands

In the black window that opens, type the following (the characters will appear on screen as you type), then press Enter:

1
node -v

If the window displays something like v22.16.0, Node.js is installed successfully ✅

Now type this command and press Enter:

1
npm -v

If it displays a version number like 10.9.2, npm is also working ✅

⚠️ Seeing “’node’ is not recognized as an internal or external command”?

Your environment variables aren’t set up correctly. See 1.4 How to Configure Environment Variables below.

How to Configure Environment Variables

What Are Environment Variables (PATH)?

PATH can be thought of as your computer’s “address book.” When you type node in the command prompt, your computer doesn’t know where node is installed — it looks it up in PATH, the “address book.” If Node.js’s installation directory isn’t in PATH, the computer can’t find it and reports “’node’ is not recognized.”

Normally, the Node.js installer adds itself to PATH automatically. But if something goes wrong, you need to add it manually.

Check If Node.js Is Already in PATH

  1. Press Win + R, type sysdm.cpl, press Enter
  2. Click the Advanced tab at the top
  3. Click the Environment Variables button at the bottom
  4. In the System variables list at the bottom, find the Path row, select it, and click Edit

In the list that pops up, check if there’s an entry like:

1
D:\nodejs\
💡 The Path Must Match Where You Installed

If you installed to D:\Software\nodejs\, then the entry should show D:\Software\nodejs\.

If the entry exists: PATH is fine, but if it’s still not working, close all current Command Prompt windows and open a new one, then try again.

If the entry doesn’t exist: Follow the steps below to add it manually.

Manually Add Node.js to PATH

  1. In the Edit Environment Variable window you just opened, click New
  2. Type the Node.js installation path:
    1
    
    D:\nodejs\
    
  3. Click OK
  4. Click OK to close the Environment Variables window
  5. Click OK to close the System Properties window
  6. Close all open Command Prompt windows and open a new one (old windows won’t pick up the new settings)
  7. Type node -v again to verify
💡 Why Configure This?

By default, npm downloads software from overseas, which is very slow. Configuring a domestic mirror speeds up downloads by more than 10 times.

In Command Prompt, type the following command and press Enter:

1
npm config set registry https://registry.npmmirror.com/

Verify with this command — if it shows https://registry.npmmirror.com/, it worked ✅:

1
npm config get registry
Step 1 Complete!

You’ve installed Node.js on your computer and configured the domestic mirror. Now let’s install Claude Code.


Install Claude Code

Install Claude Code via npm

Open Command Prompt (if not already open), type the following command, and press Enter:

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

Wait for the installation to finish (usually 1-3 minutes). Text will scroll on the screen — as long as there’s no error at the end, you’re fine.

Verify Installation

Type:

1
claude --version

Press Enter. If it shows a version number (e.g., 1.0.x), installation was successful ✅

First Launch (Skip Login)

Why Skip Login?

Claude Code officially requires you to log in with an Anthropic account. But Anthropic’s services require an overseas credit card for payment, which is inconvenient for domestic users.

Our approach: skip login first, then use the CC-Switch tool to connect to the domestic DeepSeek model. This way you don’t need an Anthropic account at all, and the cost is much lower.

Step 1: Launch Claude Code Once

Type this in Command Prompt:

1
claude

Press Enter. Claude Code will launch and may display some introductory information or ask you to log in.

Ignore it — just close the Command Prompt window (click the × in the top-right corner).

Step 2: Find the Configuration File

  1. Press Win + R (Win key and R key at the same time)
  2. In the “Run” window that pops up, type %USERPROFILE%
  3. Click OK or press Enter
  4. You’ll see a folder with various files and subfolders

Step 3: Find the .claude.json File

In this folder, look for a file named .claude.json.

⚠️ Can’t Find This File?

If you can’t find .claude.json, possible reasons:

  • File extensions are hidden — in the folder window, click View → check File name extensions and Hidden items
  • Claude Code hasn’t created this file yet — go back to Step 1 and make sure you launched Claude Code at least once
  • In some cases, the file might be inside the .claude folder, named settings.json

Step 4: Open the Config File with Notepad

  1. Right-click the .claude.json file
  2. In the popup menu, select Open with
  3. Choose Notepad
    • If Notepad isn’t in the list, select Choose another app → find Notepad in the list → click OK

Step 5: Edit the Config File

When you open it, you’ll see something like this (the exact content may vary):

1
2
3
4
{
  "someField": "someValue",
  "anotherField": "anotherValue"
}

We need to add the line "hasCompletedOnboarding": true before the final }.

After editing, it should look like this:

1
2
3
4
5
{
  "someField": "someValue",
  "anotherField": "anotherValue",
  "hasCompletedOnboarding": true
}
📌 ⚠️ Three Critical Details — Get These Wrong and It’ll Break!
  • Add a comma: the line before hasCompletedOnboarding needs an English comma , at the end
  • Use English quotes: the quotes must be English ", not Chinese "
  • true is lowercase: it must be true, not True

Step 6: Save the File

  1. Press Ctrl + S to save (or click File → Save in the top-left corner)
  2. Close the Notepad window

Step 7: Verify Skip Login Worked

  1. Reopen Command Prompt (Win + R → cmd → Enter)
  2. Type claude, press Enter
  3. If you go straight into Claude Code’s main interface (with no login prompt), skip-login was successful ✅
Step 2 Complete!

Claude Code is installed and login has been skipped. Now let’s install CC-Switch to connect DeepSeek.


Install CC-Switch (Model Switching Tool)

What Is CC-Switch?

CC-Switch is a visual tool that lets you swap Claude Code’s “brain” from the official model to DeepSeek — no manual config file editing needed, just point and click.

Download CC-Switch

Step 1: Open the Download Page

Type the following URL into your browser’s address bar and press Enter:

1
https://github.com/cc-switch/cc-switch/releases

Step 2: Find the Latest Version

Once the page loads, find the version with the green Latest label and click to expand it.

Step 3: Find the Download Link

After expanding, scroll down, find the word Assets (there may be a small arrow ▾ next to it), and click to expand it.

Find the file ending with .msi (Windows installer) and click the filename to start the download.

💡 Which File to Choose?
  • Windows computer: choose the file ending in x64.msi
  • Mac computer: choose the file ending in .dmg

Install CC-Switch

Step 1: Double-click the Installer

In the Downloads folder, double-click the downloaded .msi file. If a security prompt appears, click Run anyway or More info → Run anyway.

Step 2: Follow the Prompts

The installation wizard is similar to Node.js:

  1. Click Next
  2. Accept the agreement → Next
  3. Keep the default installation path → Next
  4. Click Install
  5. Wait for installation to complete → Finish
Step 3 Complete!

CC-Switch is installed. Now let’s get a DeepSeek API Key.


Get a DeepSeek API Key

What Is DeepSeek?

A domestic large language model with powerful performance and low pricing (about 10-30 RMB per month for daily use). Connecting to it dramatically reduces your usage costs.

What Is an API Key?

An API Key is a key used to access DeepSeek’s AI services. Each use deducts from your account balance. You need to: ① Register an account ② Add funds ③ Create a Key

Register a DeepSeek Account

Step 1: Open the DeepSeek Open Platform

Type this into your browser’s address bar:

1
https://platform.deepseek.com/

Press Enter.

💡 Note

This is DeepSeek’s developer platform (platform.deepseek.com), not the chat website (chat.deepseek.com). Don’t mix them up.

Step 2: Register / Log In

  1. In the top-right corner of the page, there are Log In / Sign Up buttons
  2. Click Sign Up (if you don’t have an account) or Log In (if you already have one)
  3. Follow the on-screen prompts to complete registration

Add Funds to Your Account

💡 Cost Reference

Daily use costs only about 10-30 RMB per month. A first-time top-up of 20-50 RMB is recommended.

  1. After logging in, find Top Up (or Wallet / Billing) in the left sidebar menu and click it
  2. Select the amount, choose a payment method, and complete the payment
  3. Make sure your account balance is greater than 0 (you can’t use the API without a balance)

Create an API Key

Step 1: Go to the API Keys Page

  1. After logging in, find API Keys in the left sidebar menu and click it
  2. You’ll see an API Keys management page

Step 2: Create a New API Key

  1. Click the Create API Key button
  2. A dialog will pop up asking you to name your Key
    • You can name it anything — claude-code, my-key, test are all fine
    • The name is just for your own reference to distinguish different Keys
  3. Click Confirm or Create

Step 3: Copy the API Key (⚠️ Most Critical Step!)

Once created, the page will display your API Key in a format like:

1
sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
⚠️ This Key Is Only Shown Once!

After you close the dialog, you’ll never see it again. Copy and save it immediately to Notepad or WeChat File Transfer.

🚨 Security Reminder

An API Key is equivalent to your account password. Don’t share it with anyone and don’t post it publicly. If you suspect it’s been leaked, delete it immediately and create a new one.

Step 4 Complete!

You now have a DeepSeek API Key. For the final step, we’ll give this key to CC-Switch to complete the connection.


Configure CC-Switch to Connect DeepSeek

Open CC-Switch

Find the CC-Switch icon on your desktop or in the Start menu and double-click to open it.

Add a DeepSeek Configuration

Step 1: Click the Add Button

Once CC-Switch opens, find the + button (plus sign) in the top-right corner and click it.

Step 2: Fill In the Configuration

After clicking +, a configuration panel will pop up. Fill in the following:

① Model Preset: Select DeepSeek

② API Key: Paste the DeepSeek API Key you copied earlier (make sure there are no leading or trailing spaces)

③ Model Name: Delete whatever is in the input box and type:

1
deepseek-v4-pro[1m]

④ Base URL / API Address (if present):

1
https://api.deepseek.com

Step 3: Save the Configuration

After double-checking all fields, click Add / Save / Confirm.

Switch to DeepSeek

  1. Return to CC-Switch’s main interface
  2. You’ll see the DeepSeek configuration you just added in the list
  3. Click the Switch / Enable button next to that configuration
  4. The interface should show “Current Model: DeepSeek” or similar

Verify the Connection

Open Command Prompt and type claude to launch Claude Code.

Inside Claude Code, type:

1
/model

Press Enter. If the displayed model info includes DeepSeek, the connection is successful ✅

All Configuration Complete!

You can now start using the AI programming assistant!


Start Using It (Hands-on Example)

Now that everything is configured, let’s do a simple exercise to make sure it all works.

Create a Project Folder and Open Command Prompt

  1. Right-click on the desktop → New → Folder, name it my-first-ai-project
  2. Double-click to open the folder
  3. Click the address bar at the top of the window, type cmd, and press Enter

Launch Claude Code

In the Command Prompt window that appears, type:

1
claude

Press Enter. If asked whether to trust this folder, type y and press Enter.

Give Your First Instruction

Once Claude Code starts, type the following (you can use plain English):

1
Help me create a simple personal homepage using HTML + CSS + JavaScript, with a title, a short self-introduction, and a dark mode toggle button

Press Enter to submit.

Handle Permission Requests

During execution, Claude Code may ask for permission to create/modify files — just select Yes. For your own projects, you can choose Yes, always allow (won’t ask again).

Check the Result

After completion, go back to the project folder and double-click index.html — it’ll open in your browser, and you’ll see the webpage the AI created for you!

Congratulations!

You’ve completed your first project with Claude Code + DeepSeek!


Command Quick Reference

Operation Command Description
Check Node.js version node -v Verify Node.js is installed
Check npm version npm -v Verify npm is working
Set npm mirror npm config set registry https://registry.npmmirror.com/ Speed up downloads
Check npm mirror npm config get registry Verify mirror is active
Install Claude Code npm install -g @anthropic-ai/claude-code Global install
Check Claude Code version claude --version Verify Claude Code is installed
Launch Claude Code claude Start in current folder
Check current model /model Type inside Claude Code
Exit Claude Code /exit or press Ctrl + C twice Quit the program

FAQ

node -v says “’node’ is not recognized as an internal or external command”?

Node.js environment variables (PATH) aren’t configured correctly. Open File Explorer and go to D:\nodejs\ to see if node.exe is there:

  • The file exists: Node.js is installed but PATH isn’t set up — follow the steps in 1.4 How to Configure Environment Variables to add it manually
  • The file doesn’t exist: Installation failed — re-download and reinstall
claude says “‘claude’ is not recognized as an internal or external command”?

Claude Code installation failed. First verify node -v and npm -v are working, then re-run npm install -g @anthropic-ai/claude-code.

Claude Code asks me to log in to an Anthropic account after launching?

The .claude.json file wasn’t edited correctly. Press Win + R, type %USERPROFILE% and press Enter, find .claude.json and open it with Notepad. Make sure it contains "hasCompletedOnboarding": true, with an English comma at the end of the preceding line, true in lowercase, and English quotation marks.

Claude Code shows errors or no response during conversation?

Common causes: ① DeepSeek account balance is insufficient ② API Key is entered incorrectly ③ Model name isn’t deepseek-v4-pro[1m] ④ Network issues. Check each one.

npm install of Claude Code is very slow (over 5 minutes)?

Check if the domestic mirror is configured: npm config get registry (should show registry.npmmirror.com). If not, run npm config set registry https://registry.npmmirror.com/ and retry.

CC-Switch won’t open or crashes on launch?

Download the latest version from GitHub Releases, or try right-clicking and running as administrator.

GitHub page won’t load?

Cause: GitHub may be unstable to access from within China. Solutions:

  • Refresh the page several times
  • Try a different browser
  • If you still can’t access it, search for “CC-Switch download” online — some domestic mirror sites may also host the download

Complete Process Review
Step Content One-Line Summary
Step 1 Install Node.js Set up the “runtime engine” so your computer can run JavaScript programs
Step 2 Install Claude Code Install the “AI assistant” and skip login
Step 3 Install CC-Switch Install the “brain-swapper” to change AI models
Step 4 Get DeepSeek API Key Get the “key” to access DeepSeek’s AI services
Step 5 Configure CC-Switch Use the “brain-swapper” + “key” to switch Claude Code’s brain to DeepSeek
Step 6 Start Using Type claude in any folder to launch your AI assistant!

After completing all steps, you can open any folder on your computer, type the claude command, and launch a DeepSeek-powered AI programming assistant!

comments powered by Disqus