scripts/installation/INSTALLATION_GUIDE.md
This guide describes how to install Node.js and Qwen Code with source information tracking.
The installation scripts automate the process of installing Node.js (if not present or below version 20) and Qwen Code, while capturing and storing the installation source information for analytics and tracking purposes.
We provide platform-specific installation scripts:
install-qwen-with-source.shinstall-qwen-with-source.bat~/.qwen/source.json# Install with a specific source
sh install-qwen-with-source.sh --source github
# Install with internal source
sh install-qwen-with-source.sh -s internal
# Show help
sh install-qwen-with-source.sh --help
github - Installed from GitHub repositorynpm - Installed from npm registryinternal - Internal installationlocal-build - Local build installation--source parameter to specify where Qwen Code is being installed from~/.qwen/source.json with the specified source information⚠️ After installation, you need to restart your terminal or run:
source ~/.bashrc # For bash users
# or
source ~/.zshrc # For zsh users
This is required to load the newly installed Node.js and Qwen Code into your PATH.
%USERPROFILE%\.qwen\source.json⚠️ Important: You must run PowerShell as Administrator to install Node.js and global npm packages.
Step 1: Open PowerShell as Administrator
Win + X and select "Windows PowerShell (Admin)"Step 2: Navigate to the script directory and run:
# Install with a specific source using --source parameter
./install-qwen-with-source.bat --source github
# Install with short parameter
./install-qwen-with-source.bat -s internal
# Use default source (unknown)
./install-qwen-with-source.bat
github - Installed from GitHub repositorynpm - Installed from npm registryinternal - Internal installationlocal-build - Local build installation--source or -s parameter to specify where Qwen Code is being installed from%USERPROFILE%\.qwen\source.json with the specified source informationC:\Program Files\nodejsThis feature implements the ability to capture and store the installation source of the Qwen Code package. The source information is used for analytics and tracking purposes.
The installation source is stored in a separate file at:
~/.qwen/source.json%USERPROFILE%\.qwen\source.json (equivalent to C:\Users\{username}\.qwen\source.json)The source.json file contains:
{
"source": "github"
}
QwenLogger class reads this file during telemetry initializationapp.channel field of the RUM payloadAfter installation and restarting your terminal (or sourcing your shell configuration), you can verify the source information:
Linux/macOS:
cat ~/.qwen/source.json
Windows:
type %USERPROFILE%\.qwen\source.json
If you prefer not to use the installation scripts or don't want source tracking:
# Node.js 20+
curl -qL https://www.npmjs.com/install.sh | sh
npm install -g @qwen-code/qwen-code@latest
brew install qwen-code
Linux/macOS:
# Run with sh
sh install-qwen-with-source.sh --source github
Windows (PowerShell as Administrator):
# Run the script with --source parameter
./install-qwen-with-source.bat --source github
# Or with short parameter
./install-qwen-with-source.bat -s github
Linux/macOS:
curl -o- https://qwen-code-assets.oss-cn-hangzhou.aliyuncs.com/installation/install_nvm.sh | bashsource ~/.bashrcWindows:
You may need administrative privileges for global npm installation:
sudo with npm