If you want to contribute to Deno or build a custom version, you’ll need to build Deno from source. If you just want to use Deno, you can download a prebuilt executable .
Prerequisites
Before building Deno, you need to install several required tools and dependencies.
Rust
Deno requires a specific release of Rust. The version required is specified in the rust-toolchain.toml file. Deno may not support building on other versions or on Rust Nightly releases.
Install or update Rust and verify the installation:
Native Compilers and Linkers
Many components of Deno require a native compiler to build optimized native functions.
Install LLVM 17 and required build tools: wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
./llvm.sh 17
apt install --install-recommends -y cmake libglib2.0-dev
Install XCode Command Line Tools: Install CMake (required but not included with Command Line Tools): For Apple M1/M2 (aarch64): Install LLVM and LLD: brew install llvm lld
# Add /opt/homebrew/opt/llvm/bin/ to $PATH
Install Visual Studio Community 2019 with the “Desktop development with C++” toolkit
Select these required components:
Visual C++ tools for CMake
Windows 10 SDK (10.0.17763.0)
Testing tools core features - Build Tools
Visual C++ ATL for x86 and x64
Visual C++ MFC for x86 and x64
C++/CLI support
VC++ 2015.3 v14.00 (v140) toolset for desktop
Enable “Debugging Tools for Windows”:
Go to Control Panel → Programs → Programs and Features
Select “Windows Software Development Kit - Windows 10”
Click Change → Change → Check “Debugging Tools For Windows” → Change → Finish
Or download from Debugging Tools for Windows
Protocol Buffers Compiler
Deno requires the Protocol Buffers compiler .
apt install -y protobuf-compiler
protoc --version # Ensure version is 3+
brew install protobuf
protoc --version # Ensure version is 3+
Download the latest binary release from GitHub .
Python 3
Deno requires Python 3 for running Web Platform Tests (WPT).
Ensure that a suffix-less python or python.exe exists in your PATH and refers to Python 3.
Cloning the Repository
Deno uses git submodules, so you must clone with the --recurse-submodules flag.
git clone --recurse-submodules https://github.com/denoland/deno.git
Verify Git version
Ensure you’re using git version 2.19.2.windows.1 or newer.
Configure symlinks
Set core.symlinks=true before cloning: git config --global core.symlinks true
git clone --recurse-submodules https://github.com/denoland/deno.git
Building Deno
The easiest way to build Deno is by using a precompiled version of V8.
For WSL users: Make sure you have sufficient memory allocated in .wslconfig. It is recommended that you allocate at least 16GB.
Standard Build
Build using precompiled V8 (recommended for most development):
Build from Source with V8
If you’re doing lower-level V8 development or using a platform without precompiled V8:
V8_FROM_SOURCE = 1 cargo build -vv
When building V8 from source, there may be additional dependencies. See rusty_v8’s README for details.
Build Variants
Debug Build (default)
Fast Development Build
Release Build
Check Only
# Standard debug build
cargo build -vv
Troubleshooting Build Issues
If you encounter build errors:
# Ensure you have the latest code
git pull origin main
# Clean and rebuild
cargo clean && cargo build -vv
Running Your Build
After building, the binary is located at ./target/debug/deno:
Run a Script
Run with Permissions
Eval Code
Start REPL
./target/debug/deno run tests/testdata/run/002_hello.ts
Running Tests
Deno has a comprehensive test suite written in both Rust and TypeScript.
Rust Tests
Run Rust tests during the build process:
TypeScript Tests
Run the TypeScript unit tests:
All Unit Tests
Specific Test File
target/debug/deno test -A --unstable \
--lock=tools/deno.lock.json \
--config tests/config/deno.json \
tests/unit
Working with Multiple Crates
If you’re working on changes that span multiple Deno crates, you can use Cargo’s patch feature.
Recommended Directory Structure
denoland/
deno/
deno_core/
deno_ast/
...
Using Cargo Patch
Override dependency paths on the command line: cargo build --config 'patch.crates-io.deno_ast.path="../deno_ast"'
For longer development sessions, add to Cargo.toml (remember to remove before committing): [ patch . crates-io ]
deno_ast = { path = "../deno_ast" }
The version in your local crate’s Cargo.toml must match the version Deno expects. Use cargo search <dependency_name> to check versions.
Next Steps
Now that you have Deno built from source: