# Installation & Preparation

## Installing the runtime

TouchGuild is built using the Node.js runtime, so we highly recommend to use it to not face unexpected compatibility issues.

You can also use TouchGuild with [Bun](https://bun.sh) instead of Node.js (we tested it and it worked!) and any other runtime that is Node.js (as well as npm) compatible.

{% hint style="danger" %}
We're developing TouchGuild using Node.js, we cannot ensure that using it with Bun or any other runtime will work as expected.
{% endhint %}

So let's get started installing Node.js or Bun, shall we?

### Method 1: Installing Node.js

To use TouchGuild, you'll need to install [Node.js](https://nodejs.org/). The latest TouchGuild version (v1.x.x) requires Node.js v16.16.0 or higher.

{% hint style="info" %}
If you'd like to check if you have Node.js installed in your machine, run `node -v` in your terminal. If it outputs `16.16.0` or higher, then you're good to go! Otherwise, continue reading the steps below.&#x20;
{% endhint %}

On macOS, either:

* Download the latest version from the [Node.js website](https://nodejs.org/en/). Open the downloaded file & follow the instructions.
* Use a package manager like [Homebrew ](https://brew.sh/)& run the command `brew install node`

On Windows, it's as simple as downloading any other program. Download the latest version from the [Node.js website](https://nodejs.org/en/). Open the downloaded file & follow the instructions.

On Linux, you can consult [this page](https://nodejs.org/en/download/package-manager/) to determine how you should install Node.js.

#### Creating the bot's folder

To build a bot, we'll need to create a folder for it.

#### Initiating the project folder <a href="#initiating-a-project-folder" id="initiating-a-project-folder"></a>

Run this command in the bot's folder you created to initialize your project folder:

{% tabs %}
{% tab title="npm" %}

```bash
npm init
```

{% endtab %}

{% tab title="yarn" %}

```bash
yarn init
```

{% endtab %}

{% tab title="pnpm" %}

```bash
pnpm init
```

{% endtab %}
{% endtabs %}

When running this command, a new file will appear in your folder: `package.json`, this file lists dependencies of your projects as well as other information about your project.

Once you're done, you're ready to install TouchGuild!

#### Installing TouchGuild

To install TouchGuild, we'll use the Node's package manager (npm).

Run the command below:

{% tabs %}
{% tab title="npm" %}

```bash
npm install touchguild
```

{% endtab %}

{% tab title="yarn" %}

```bash
yarn add touchguild
```

{% endtab %}

{% tab title="pnpm" %}

```bash
pnpm add touchguild
```

{% endtab %}
{% endtabs %}

You're almost ready to code your Guilded bot!

### Method 2: Installing Bun instead of Node.js

As said earlier, you can install Bun instead of Node.js, but we cannot ensure that it'll work properly, we only tried it once. As long as Bun supports Node.js and is fully compatible, you won't have any issue when it comes to developing using TouchGuild.

Paste into your Terminal:

{% tabs %}
{% tab title="macOS" %}
{% code fullWidth="true" %}

```sh
curl -fsSL https://bun.sh/install | bash
```

{% endcode %}

Using Homebrew (if you have it installed):

```sh
brew install oven-sh/bun/bun
```

{% endtab %}

{% tab title="Windows" %}

```powershell
powershell -c "irm bun.sh/install.ps1|iex"
```

{% endtab %}

{% tab title="Linux" %}

```sh
curl -fsSL https://bun.sh/install | bash
```

{% endtab %}
{% endtabs %}

More ways & more information on how to install Bun (Guide): <https://bun.sh/docs/installation>

#### Create a folder for your project

To build a bot, we'll need to create a folder for it.

#### Initiating the project folder

Run the following command to&#x20;

```sh
bun init
```

After executing it, follow the instruction given by the command (you don't have to specify anything if you don't want to, you can press enter multiple times to skip).

After that, you should see that some files have been added to your folder, this includes your `package.json` that is used to manage your dependencies and list other information about your project, and some other files.

You're one step closer to adding TouchGuild to your brand new project.

#### Installing TouchGuild

Finally! We're installing it!

Run the following command into your terminal in your project folder (it is npm compatible).

```sh
bun install touchguild
```

TouchGuild is ready to use!

## Installing a linter <a href="#installing-a-linter" id="installing-a-linter"></a>

While coding, you can run into numerous syntax errors or code in an inconsistent style. It is recommended to install a linter (e.g: ESLint) to ease these troubles.

Now you're ready to code your Guilded bot with TouchGuild.
