Skip to main content

Prerequisites

You will need to install these tools on your machine:
  • Node.js
  • Yarn
  • Python 3
  • Xcode and Xcode Command Line Tools (Xcode → Preferences → Downloads)

Installing Dependencies

1

Install Node.js

Check if you have the right version of Node.js installed:
node -v
If you see an error, download Node from the Node.js website and install the package.Verify your installed version matches our .node-version file. Usually the same major version is enough.
We support these Node version managers: nvm and asdf-nodejs.Using nvm:
  1. Install nvm using the instructions here
  2. Within the Desktop source directory, install the required version:
    nvm install
    
  3. Ensure you are running the right version:
    nvm use
    
  4. Verify by running node -v again
Using asdf-nodejs:Check out the instructions here and here for installation details.
2

Install Yarn

Follow this guide to install a system-level yarn.
GitHub Desktop uses a local version of yarn, but it needs a version on your PATH to bootstrap itself. Yarn uses lock files to pin dependencies and prevent version mismatches between machines.
3

Verify Python 3

macOS comes with Python pre-installed. Verify you have the right version:
python3 --version
You should see Python 3.9.x or similar.
We recommend pyenv for managing Python versions.
  1. Install pyenv according to the instructions
  2. Within the Desktop source directory, install the required version:
    pyenv install
    
  3. Verify by running python3 --version again
4

Install Xcode Command Line Tools

Run this command to install the Xcode command line tools:
xcode-select --install
If you already have them installed, it will notify you.

Verify Installation

Verify you have these commands available in your shell and that the found versions look similar to the output below:
node -v
# v20.17.0

yarn -v
# 1.21.1

python --version
# Python 3.9.x

Building Desktop

1

Fork and clone the repository

Create a fork of desktop/desktop and clone it to your local machine. Navigate into the repository directory.
2

Install dependencies

Run yarn to get all required dependencies:
yarn
3

Create a development build

Build the application for development:
yarn build:dev
4

Launch the application

Start the application:
yarn start
Changes will be compiled in the background. Reload the app to see changes using Ctrl/Command+Alt+R.
Optional Tip: On macOS and Linux, you can use screen to avoid filling your terminal with logging output:
screen -S "desktop" yarn start  # -S sets the name of the session
# Your screen clears and shows logs. Press Ctrl+A then D to exit.
screen -R "desktop"  # to reopen the session
If you’ve made changes in the main-process folder, you need to run yarn build:dev to rebuild the package, and then yarn start for these changes to be reflected in the running app.

Running Tests

yarn test
For more information on test arguments, see Node CLI options.

Debugging

1

Launch the app

Run yarn start to launch the app.
2

Open Developer Tools

Under the View menu, select Toggle Developer Tools.Electron ships with Chrome Dev Tools to assist with debugging, profiling, and other measurement tools.
When running the app in development mode, React Dev Tools should automatically install itself on first start.

Additional Resources

Next Steps

Once your environment is set up, check out:

Build docs developers (and LLMs) love