Prerequisites
Before building VS Code from source, ensure you have the following installed:Node.js
Required for running build scripts and dependencies
Git
For cloning the repository and version control
Python
Required for building native modules
C++ Compiler
Platform-specific compiler for native dependencies
Development Container Available: VS Code includes a Dev Container configuration that provides a pre-configured environment with all prerequisites. Docker needs at least 4 Cores and 8 GB of RAM (9 GB recommended).
System Requirements
- macOS
- Linux
- Windows
- Xcode Command Line Tools: Install with
xcode-select --install - Node.js: Version specified in
.nvmrc - Python: Version 3.x
- Minimum RAM: 8 GB (16 GB recommended)
Getting the Source Code
Install Dependencies
Install all npm dependencies. The
postinstall script will automatically run after installation:The postinstall script (
build/npm/postinstall.ts) handles additional setup tasks automatically.Building VS Code
Full Compilation
Compile all TypeScript sources using Gulp:Building Specific Components
Running from Source
- macOS/Linux
- Windows
Launch VS Code from source:The script will:
- Run the preLaunch task (if
VSCODE_SKIP_PRELAUNCHis not set) - Set development environment variables
- Launch Electron with VS Code
NODE_ENV=developmentVSCODE_DEV=1VSCODE_CLI=1ELECTRON_ENABLE_STACK_DUMPING=1ELECTRON_ENABLE_LOGGING=1
Running Web Version
Launch VS Code in a browser:The web version runs on
http://localhost:8080 by default.Build Optimization
Watch Mode for Development
For active development, use watch mode to automatically recompile on file changes:watch-client-transpile: Transpiles client TypeScriptwatch-client: Watches client codewatch-extensions: Watches extension code
Individual Watch Tasks
Using Deemon for Process Management
Deemon provides daemon-style process management for watch tasks:Production Builds
For production-ready builds:Using Development Containers
Local Development Container
Install Prerequisites
- Docker Desktop (macOS/Windows) or Docker (Linux)
- VS Code with Dev Containers extension
GitHub Codespaces
Access Desktop
The codespace provides a VNC-based desktop environment:
- VNC Port: 5901
- Web Client: Port 6080 (http://localhost:6080)
- Password:
vscode
Troubleshooting
Build Failures
Out of Memory Errors
Out of Memory Errors
Increase Node.js heap size:
Native Module Compilation Fails
Native Module Compilation Fails
Ensure you have the correct C++ compiler:
- macOS: Install Xcode Command Line Tools
- Linux: Install
build-essential - Windows: Install Visual Studio with C++ workload
Electron Download Issues
Electron Download Issues
Set the Electron mirror if you’re behind a firewall:
Slow Builds on macOS/Windows
Slow Builds on macOS/Windows
Use WSL on Windows or the Dev Container approach for better I/O performance:
Clean Build
If you encounter persistent issues, perform a clean build:Next Steps
Development Workflow
Learn about the development workflow and tools
Debugging
Set up debugging for VS Code development
Running Tests
Learn how to run and write tests
Contributing
Read the contribution guidelines