How to Fix Codex App Not Working on Windows with Chinese Directories: A Step-by-Step Guide for Beginners

If your Windows user directory is in Chinese and Codex won’t launch or shows errors after installation, this guide is for you.

I’ll walk you through the simplest way to get Codex working on Windows, even with non-English paths. You don’t need deep technical knowledge—just follow the steps in order.


What Is Codex and Who Is This For?

Codex (by OpenAI) is an AI coding assistant that can “enter” your project folder to help you read, edit, debug, and document code. It’s more than a chat window—it works inside your codebase.

This guide is for:

  • Windows users with Chinese (or non-English) usernames or directories
  • Beginners new to AI coding tools
  • People who installed Codex but can’t open it due to path issues
  • Anyone moving from “chat-only” AI to “AI inside my project”

Notes:

  • This guide focuses on Windows. Mac/Linux steps differ.
  • Codex availability depends on your account, region, and network. This guide covers official installation and local usage.
  • Avoid unofficial “cracked” or “domestic repacks.” They risk source leaks and account bans.

What You Need Before Starting

Prepare these tools. I’ll explain their roles briefly—you just need to install them in order.

  1. Node.js: Runtime environment. Codex CLI depends on it.
  2. npm: Node’s package manager. Used to install Codex.
  3. Git: Version control. Helps you back up before changes.
  4. VS Code: Code editor (optional but recommended for easier debugging).
  5. Codex: The AI assistant you want to run.

You don’t need to understand every detail yet—just install them step by step.


Step 1: Install Node.js

The easiest way is to install the LTS (Long-Term Support) version of Node.js.

Download and Install

  1. Go to the Node.js official website.
  2. Download the Windows Installer x64 for LTS.
  3. Double-click the .msi file and begin installation.
  4. During setup:

    • Click “Yes” for any permission prompts.
    • Click “Next” and keep the default install path.
    • Ensure npm package manager and Add to PATH are checked.
  5. Wait for installation to finish.

Verify Installation

Press Win + R, type cmd, and press Enter to open Command Prompt.

Run:

node -v
npm -v

If you see version numbers (e.g., v20.x.x and 10.x.x), Node.js and npm are ready.


Step 2: Optional — Use nvm to Manage Node.js (Advanced)

If you plan to switch Node versions across projects later, use nvm. For a first-time Codex setup, you can skip this.

If you want to try:

  1. Download the nvm-windows .exe installer.
  2. Install with default paths (avoid Chinese directories).
  3. Common commands:
nvm version                # Check nvm
nvm list available         # Show available Node versions
nvm install 22.22.2        # Install a specific version
nvm list                   # List installed versions
nvm use 22.22.2            # Switch to a version

If you already have Node.js installed, ignore nvm for now—just focus on getting Codex running.


Step 3: Install Git

Git helps you save code changes so you can recover if Codex makes a mistake.

Download and Install

  1. Go to the Git website.
  2. Download Git for Windows x64.
  3. Double-click the installer and follow these steps:

    • Keep the default install path (usually C:\Program Files\Git).
    • Keep default component selection.
    • For the default editor, choose VS Code if installed; otherwise keep default.
    • For PATH, select: Git from the command line and also from 3rd-party software.
    • Keep all other options default.
  4. Click “Install” to finish.

Verify Installation

In Command Prompt, run:

git --version

If you see something like git version 2.x.x, Git is ready.

Configure Username and Email (for commit records)

git config --global user.name "Your Name"
git config --global user.email "your.email@example.com"
git config --global --list

This only records who made changes—it doesn’t log you into an account.


Step 4: Install VS Code

VS Code isn’t required, but it makes viewing and editing code easier.

Download and Install

  1. Go to the VS Code website.
  2. Windows users: download Windows User Installer x64.
  3. During installation, check:

    • Add to PATH
    • Open with Code (right-click menu)
    • Register as editor for supported file types

After installation, you can launch VS Code from the Start menu or desktop.


Step 5: Install Codex

There are three ways to use Codex. I’ll explain each.

Option 1: Codex App (GUI, No Terminal Needed)

If you prefer a graphical interface, try the Codex App first.

  1. Open the official entry point.
  2. Windows users will be redirected to the Microsoft Store to download.
  3. Install, open, and sign in with your ChatGPT account.
  4. Choose a project folder to start.

Note: If your user directory is in Chinese, the Codex App may fail. Use Option 2 or 3 instead.


Option 2: Codex CLI (Command Line, Works with Any Directory)

The CLI is the most reliable method and works even with non-English paths.

  1. Open PowerShell.
  2. Run:
npm i -g @openai/codex
  1. Wait for installation to complete.
  2. Verify:
codex --version
  1. First run:
codex

It will prompt you to sign in with your ChatGPT account or use an API key. For beginners, sign in via the prompt.


Option 3: VS Code Extension (GUI, No Terminal Needed)

If you prefer not to use the terminal, install Codex inside VS Code.

  1. Open VS Code.
  2. Go to Extensions (square icon on the left).
  3. Search for “Codex.”
  4. Install the official OpenAI Codex extension—avoid third-party lookalikes.
  5. Sign in and start using it.

Step 6: Let Codex See Your Project (First Use)

Many beginners install Codex but don’t know how to let it “see” their project. It’s simple:

You must open the terminal inside your project folder before running Codex.

Example Steps

Assume your project folder is demo on the Desktop.

  1. Open the demo folder in File Explorer.
  2. In the address bar at the top, type cmd and press Enter.

    • This opens Command Prompt directly in that folder.
  3. Run:
codex

Codex will start in the current project directory.

First-Time Tips

Don’t ask Codex to change code immediately. Start with:

Please analyze this project’s structure and explain what it does and how to run it. Do not modify any code yet.

Adding “do not modify any code” prevents accidental changes.


Step 7: Back Up Before Letting Codex Modify Code

Codex can edit code—this is powerful but risky for beginners. Always back up first.

Method 1: Use Git (Recommended)

If your project is already a Git repository:

git status
git add .
git commit -m "before codex changes"

Method 2: Manual Copy (For Non-Git Users)

Simply duplicate the entire project folder as a backup.

Recommendation: Back up first, then modify. You can also ask Codex: “Please make a git commit before changing anything.”


Common Issues and Fixes

1. “npm is not recognized” or “node is not recognized”

Cause: Node.js not installed correctly or PATH not refreshed.

Fix:

  1. Close PowerShell/CMD.
  2. Reopen it.
  3. Run node -v and npm -v.
  4. If still not recognized, reinstall Node.js and check “Add to PATH.”

2. “codex is not recognized”

Cause: Global install path not refreshed.

Fix:

  1. Re-run:
npm i -g @openai/codex
  1. Close and reopen PowerShell.
  2. Run codex --version.

3. Slow Downloads

  • Try a more stable network.
  • Refresh a few times; avoid frequent interruptions.
  • Always download Node.js, Git, VS Code, and Codex from official sites—no third-party bundles.

4. Can’t Sign In to Codex

Check:

  • Can you log into ChatGPT normally?
  • Does your account have Codex access?
  • Is your network able to reach the service?
  • Is your browser blocking the login redirect?
  • Are you using the official OpenAI Codex?

5. I Don’t Know Code—Can I Still Use Codex?

Yes, but don’t ask it to make big changes right away.

Try this first prompt:

Please explain this project like you’re teaching a beginner. Tell me what each folder does and how to run it. Do not modify any code.

Once you understand the project, you can ask for small edits.


Recommended Installation Order (For Beginners)

Follow this sequence to avoid issues:

  1. Install Node.js LTS.
  2. Check with node -v and npm -v.
  3. Install Git.
  4. Check with git --version.
  5. Install VS Code.
  6. Open PowerShell.
  7. Run npm i -g @openai/codex.
  8. Check with codex --version.
  9. Navigate to your project folder.
  10. Run codex.
  11. Sign in.
  12. Ask Codex to analyze first—don’t modify code yet.

Final Reminders

  • In China, setup issues are often caused by Node.js, Git, npm, or VS Code—not Codex itself.
  • Install one tool at a time and verify it works before moving on.
  • Never download unofficial “all-in-one” packages.
  • Never let Codex modify code without a backup.

Follow this guide step by step, and your Windows Chinese directory issue will be resolved. Codex will work smoothly, and you’ll be ready to use AI inside your projects.