Development on Windows
This guide will describe two ways how to run Trezor Suite dev environment & build pipeline on a Windows system:
natively on Windows or through WSL.
Native Windows
Running the dev environment natively on Windows is not most straightforward, but it should offer best compatibility.
Prerequisites
- Install Python preferably via the Python for Windows installer, maybe Microsoft Store could work too
- Install latest Visual Studio Community with C++ build tools
- Make sure to install the "Desktop development with C++" workload
- FYI: it's necessary so that yarn packages with native code can be built,
node-gypdepends on it: details
- Install git using the installer and make sure to include git bash for Windows
- Install nodeJS version as per .nvmrc
- nvm is not supported on Windows, forks exists but manual nodeJS installation from
.msiwill work.- Do not check build tools with Chocolatey (already installed with Visual Studio)
- nvm is not supported on Windows, forks exists but manual nodeJS installation from
- Enable Yarn through npm
- Install Git LFS
- It is imperative that all further commands are run in bash for Windows, not in cmd or powershell!
- Especially, do not run any
yarncommand in a shell other than bash for Windows. If you have done so, deletenode_modulesand start over.
- Especially, do not run any
Setup
- Proceed with the Getting Started instructions in README.
- (except possibly the
nvmstep, depending on your choice)
- (except possibly the
Tips
- Exclude the
trezor-suitefolder from Windows Defender, as it may slow down the build process considerably
Windows Subsystem for Linux
⚠ Using WSL is a more sandboxed way to run the dev env, but note that it is not actively maintained, and not all features may work.
Setup
On Windows:
- Install an Ubuntu WSL2 (must be v2, you may upgrade existing v1 WSL to v2)
- Install USBIPD
In WSL:
- Run
sudo apt-get install build-essential - Install these Electron dependencies for Linux
- Install udev rules as per the Trezor docs
Then proceed with the Getting Started instructions in README.
Connecting USB device
On Windows, run usbipd list, find the bus id of the Trezor device, e.g. 2-1.
Then run:
usbipd bind --busid 2-1
usbipd attach --wsl --busid 2-1
In WSL, run lsusb to confirm the device is visible.
Note: Without udev rules, the device will be visible by lsusb, but not in the app.