You will need to install these tools on your machine:
- Node.js
- Yarn
- Python 2
- Visual C++ Build Tools
Let's see if you have the right version of node
installed. Open a shell and
run this command:
$ node -v
If you see an error about being unable to find node
, that probably means you don't have any Node tools installed.
You can download Node from the Node.js website, install the package, and restart your shell.
If you see the output v12.x.y
or later, you're good to go.
Node.js installation notes:
- make sure you allow the Node.js installer to add
node
to thePATH
.
We currently support nvm
.
-
Install
nvm
using the instructions here. -
Within the Desktop source directory, install the version of Node.js it requires:
$ nvm install
- Ensure you are running the right version:
$ nvm use
- Verify you have the right version by running
node -v
again:
$ node -v
If you see any version number, you're good to go.
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.
This is important because yarn
uses lock files to pin dependencies. If you
find yourself changing packages, this will prevent mismatches in versions
between machines.
If you're not familiar with yarn
, please read this document
to help familiarize yourself with how to do the common package tasks that are
relevant to Desktop.
Open a shell and run this command:
$ python --version
If you see the output Python 2.7.x
, you're good to go!
If you see an error about being unable to find python
, that probably means you
don't have Python installed. You can install Python 2.7 from the
Python website.
Python installation notes:
- Let Python install into the default suggested path (
c:\Python27
), otherwise you'll have to configurenode-gyp
manually to look at a different path. - Ensure the Add python.exe to Path option is selected.
To build native Node modules, you will need a recent version of Visual C++ which can be obtained in several ways:
If you have an existing installation of VS2019, run the Visual Studio Installer (Tools > Get Tools and Features...) and check that you have the Desktop development with C++ workload included.
Once you've confirmed that, open a shell and run this command to update the configuration of NPM:
$ npm config set msvs_version 2019
$ npm config set msbuild_path "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\[VERSION]\\MSBuild\\Current\\Bin\\MSBuild.exe"
Note: VERSION will be Community, Professional or Enterprise depending on your install.
If you have an existing installation of VS2017, run the Visual Studio Installer (Tools > Get Tools and Features...) and check that you have the Desktop development with C++ workload included.
Once you've confirmed that, open a shell and run this command to update the configuration of NPM:
$ npm config set msvs_version 2017
If you do not have an existing Visual Studio installation, there is a standalone Visual C++ Build Tools installer available.
After installation open a shell and run this command to update the configuration of NPM:
$ npm config set msvs_version 2019
If your local copy gets "stuck" try deleting the folder C:\Users\[Your_User]\AppData\Roaming\GitHub Desktop-dev
.
Once you've installed the necessary dependencies, head back to the setup page to finish getting set up.