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-gyp depends 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 .msi will work.
      • Do not check build tools with Chocolatey (already installed with Visual Studio)
  • 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 yarn command in a shell other than bash for Windows. If you have done so, delete node_modules and start over.

Setup

Tips

  • Exclude the trezor-suite folder 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:

In WSL:

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.