# Installing the prerequisites

Before beginning to use Truman, you will need to download all the prerequisite software necessary for running Truman on your local device.&#x20;

Below is a list of all the software you will need to download:&#x20;

1. [Homebrew ](#homebrew-mac-only)(Mac Only)&#x20;
2. [Node Version Manager (nvm) ](#node-version-manager-nvm)
3. [Node.js and Node Package Manager (npm)](#node.js-and-node-package-manager-npm)
4. [GitHub Desktop ](#github-desktop)
5. [Visual Studio Code](#visual-studio-code)

The instructions on how to install each prerequisite can be found below.

***

## <img src="https://797468930-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOR396HK0xjvBHL78w6Qi%2Fuploads%2FO1B253S12AwSAPXHsnco%2Fimage.png?alt=media&#x26;token=61e19204-bccf-405d-b0bf-ed902eab7b69" alt="" data-size="line"> Homebrew <mark style="color:red;">(Mac Only)</mark>

Follow the instructions here to install Homebrew: <http://brew.sh>.&#x20;

Homebrew is a free and open-source software package management system, and it simplifies software installation on Apple's macOS. You will use Homebrew in the later steps to install the rest of the required software.

This does not work for Windows.

## <img src="https://797468930-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOR396HK0xjvBHL78w6Qi%2Fuploads%2FbbNd7YHRSzPn8JAW1Cys%2Fimage.png?alt=media&#x26;token=07ad8f8a-92b0-4757-8229-cecf7e306d72" alt="" data-size="line"> Node Version Manager (nvm)&#x20;

Node Version Manager (nvm) allows you to install multiple versions of Node.js and to easily change between the versions. This is extremely useful if you use different versions of Node.js for different projects (for example: one project runs Node.js v.14.16.0, while another projects runs Node.js v.10.16.0).&#x20;

If you already have Node.js installed on your local computer and you do not want to use a node version manager, you can skip this step. Otherwise, follow the instructions below.&#x20;

1. First, check if Node.js is already installed by entering the following command in the terminal/command prompt: \
   \
   `node --version`\
   \
   If a version number is printed in the terminal/command prompt (ex: something like v10.16.0 will appear), it means you have Node.js installed. You will need to uninstall it.<br>
2. To uninstall:

{% tabs %}
{% tab title="Mac" %}
Enter the following command in the terminal:&#x20;

{% code title="Uninstall any versions of Node.js you currently have:" %}

```
brew uninstall --force node
```

{% endcode %}
{% endtab %}

{% tab title="Windows" %}
Follow the instructions in the first answer here: <https://stackoverflow.com/questions/20711240/how-to-completely-remove-node-js-from-windows>.
{% endtab %}
{% endtabs %}

3. Then, install nvm.&#x20;

{% tabs %}
{% tab title="Mac" %}
Enter the following commands in the terminal:&#x20;

{% code title="Install NVM via Homebrew:" %}

```
brew install nvm
```

{% endcode %}

{% code title="Create NVM's working directory if it doesn't exist:" %}

```
mkdir ~/.nvm
```

{% endcode %}

{% code title="Add the following to your shell profile e.g. \~/.profile or \~/.zshrc:" %}

```
export NVM_DIR="$HOME/.nvm"
    [ -s "$HOMEBREW_PREFIX/opt/nvm/nvm.sh" ] && \. "$HOMEBREW_PREFIX/opt/nvm/nvm.sh" # This loads nvm
    [ -s "$HOMEBREW_PREFIX/opt/nvm/etc/bash_completion.d/nvm" ] && \. "$HOMEBREW_PREFIX/opt/nvm/etc/bash_completion.d/nvm" # This loads nvm bash_completion

```

{% endcode %}
{% endtab %}

{% tab title="Windows" %}

1. Download the **nvm-setup.zip** file for the most recent release [here](https://github.com/coreybutler/nvm-windows/releases).
2. Once downloaded, open the zip file, then open the **nvm-setup.exe** file.
3. The Setup-NVM-for-Windows installation wizard will walk you through the setup steps, including choosing the directory where both nvm-windows and Node.js will be installed. <br>

   <figure><img src="https://797468930-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOR396HK0xjvBHL78w6Qi%2Fuploads%2FC9IqfcqDmrR9CK3kbw0A%2Fimage.png?alt=media&#x26;token=6c4aec9f-b690-486b-816c-81ee858781e8" alt="" width="563"><figcaption></figcaption></figure>

{% endtab %}
{% endtabs %}

4. Confirm you have NVM installed by entering `nvm -v` in the terminal/command prompt. A version number should be printed if it has been installed properly.

## <img src="https://797468930-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOR396HK0xjvBHL78w6Qi%2Fuploads%2FjDKKGBaKRyiDykR8IlPm%2Fimage.png?alt=media&#x26;token=cab74500-e93d-4336-86a9-d4d46da26d51" alt="" data-size="line"> Node.js and Node Package Manager (npm)

Node.js is a server-side JavaScript runtime environment built on top of Google Chrome V8 JavaScript engine. It allows JavaScript code to run outside of a web browser and on a server, and therefore is typically used to easily and quickly build web applications on the server-side (back end).

Node Package Manager (npm) is the standard package manager for Node.js that makes downloading and managing the dependencies of Node.js packages easy.&#x20;

It is not too important to understand what both of these things do.&#x20;

If you already have Node.js installed on your local computer, you can skip this step. Otherwise, follow the instructions below.&#x20;

{% hint style="info" %}
Truman was created in 2019 with Node.js v.10.x.x. Since then, it has had a few updates. The most recent version of Truman runs on Node.js v.18.17.0, so we will install Node.js v.18.17.0.
{% endhint %}

1. To install Node.js v.18.17.0, enter the following command in the terminal/command prompt: \
   \
   `nvm install 18.17.0`\
   \
   If it installed properly, you should see "Installation complete. If you want to..." printed in the terminal/command prompt.<br>
2. Then, tell the computer to use Node.js v.18.17.0 by entering the following command in the terminal/command prompt: \
   \
   `nvm use 18.17.0`

## <img src="https://797468930-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOR396HK0xjvBHL78w6Qi%2Fuploads%2FPxrhUPslbfopTw57GTqN%2Fimage.png?alt=media&#x26;token=fd6a2ed6-f872-415d-afaf-89569da2361a" alt="" data-size="line"> GitHub Desktop&#x20;

Git is a version control system that tracks changes in computer files. It is typically used to coordinate work among programmers who are collaboratively developing source code during software development. GitHub Desktop is an application that provides an easy interface to use Git.&#x20;

If you already have a workflow for pulling/pushing code from GitHub, you can skip this step. Otherwise, follow the instructions below.&#x20;

1. Download GitHub Desktop here: <https://desktop.github.com/>.&#x20;
2. In your computer's `Downloads` folder, double-click the **GitHub Desktop** **setup** file. This will install the application.
3. GitHub Desktop will launch after installation is complete. It will prompt you to sign in to your GitHub account. If you do not have a GitHub account, sign up for one [here](https://github.com/).
4. After signing into your GitHub account, you will be prompted by the application to allow access to your GitHub repositories. Allow access to all repositories (Public and Private) and then click the green **Authorize desktop** button.

## <img src="https://797468930-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOR396HK0xjvBHL78w6Qi%2Fuploads%2F4Ye0Ez5HmmdZU0AwmkIm%2Fimage.png?alt=media&#x26;token=01a83fd1-ad03-4c2a-94a2-d09b77b16afa" alt="" data-size="line"> Visual Studio Code

Visual Studio Code is a source-code editor, making it easier to make changes to the code in the codebase.

If you already have a source-code editor that you use to (like Atom, Sublime Text), you can skip this step. Additionally, if you do not plan to make any changes to the code, you can also skip this step.&#x20;

1. Follow the instructions here to download Visual Studio Code: <https://code.visualstudio.com/>.
