Skip to main content

Prerequisites

Before installing Qwen Code, ensure you have the following:

Node.js

Version 20 or later is required. Download from nodejs.org.

Terminal

A modern terminal that supports ANSI colors and UTF-8 encoding.
Check your Node.js version with node --version. If you need to manage multiple Node.js versions, consider using nvm.
The fastest way to get started is with our installation script. It automatically detects your platform and installs Qwen Code globally.
Windows users: Run the command prompt as Administrator to ensure proper installation.

After Installation

Restart your terminal to ensure environment variables take effect:

Manual Installation

If you prefer manual installation or need more control, use one of these methods:

NPM (All Platforms)

Install globally using npm:
Verify the installation:
The global installation makes the qwen command available system-wide.

Homebrew (macOS, Linux)

If you use Homebrew package manager:
Verify the installation:

Package Manager Comparison

Updating Qwen Code

Keep Qwen Code up to date to get the latest features and bug fixes.
Qwen Code automatically checks for updates when you run it. You’ll see a notification if a new version is available.

Installation Verification

After installation, verify everything is working correctly:
1

Check version

You should see output like: @qwen-code/qwen-code 0.12.1
2

Test help command

This displays all available CLI options and commands.
3

Launch interactive mode

This starts the interactive terminal UI. Press Ctrl+C or type /exit to quit.

Development Installation

If you want to contribute to Qwen Code or run from source:
1

Clone the repository

2

Install dependencies

This installs all packages in the monorepo workspace.
3

Build the project

This compiles TypeScript and bundles all packages.
4

Run from source

Or for development mode with hot reload:
For development, use Node.js version ~20.19.0 with nvm for best compatibility.

Troubleshooting

Common Issues

Issue: The qwen command is not recognized after installation.Solutions:
  1. Restart your terminal to reload PATH variables
  2. Check if npm global bin is in your PATH:
    The bin directory should be in your system PATH.
  3. For npm installations, try:
Issue: NPM installation fails with permission errors.Solutions:
  1. On macOS/Linux: Use a Node version manager like nvm (recommended)
  2. Alternative: Configure npm to use a different directory:
  3. Not recommended: Use sudo (can cause permission issues later)
Issue: Error about unsupported Node.js version.Solutions:
  1. Check your Node.js version:
  2. Update to Node.js 20 or later from nodejs.org
  3. Or use nvm to install the correct version:
Issue: Installation fails on Windows.Solutions:
  1. Run Command Prompt or PowerShell as Administrator
  2. Ensure Windows Build Tools are installed:
  3. Use the Windows install script instead of npm
  4. Consider using WSL2 (Windows Subsystem for Linux) for a Linux environment

Getting Help

If you continue to experience issues:

GitHub Issues

Search existing issues or create a new one

Discord Community

Ask for help in our community Discord

Uninstallation

If you need to remove Qwen Code:
To also remove configuration files:
Removing ~/.qwen deletes all your settings, authentication tokens, and session history.

Next Steps

Now that Qwen Code is installed, set up authentication to start using it:

Configure Authentication

Set up Qwen OAuth or API key authentication →