# Installation

## Installation Guide

The Node.js version Taxo needs depends on your edition. It comes from each edition's `package.json`:

| Edition | Node.js version                                                                          |
| ------- | ---------------------------------------------------------------------------------------- |
| Astro   | 22.19.0 or later                                                                         |
| Tina    | 22 (22.23.4 or later) or 24. Tina's command line tool supports only those two versions   |
| Sanity  | 22.23.4 or later                                                                         |

<Aside type="tip">
  Use the theme's built-in `npm` scripts whenever possible. They handle the
  setup steps Taxo needs during development and production builds.
</Aside>

### Install Node.js

<Tabs>
  <TabItem label="Windows">

    1. Download Node.js from [nodejs.org](https://nodejs.org/en/download/).
    2. Install it with the default setup.
    3. Verify the version:

    ```bash
    node -v
    ```

    You should see the version from the table above, or newer.

  </TabItem>

  <TabItem label="macOS">

    1. Install [Homebrew](https://brew.sh/) if you do not already have it.
    2. Install Node.js:

    ```bash
    brew install node
    ```

    3. Verify the version:

    ```bash
    node -v
    ```

  </TabItem>

  <TabItem label="Linux">

    Install Node.js using your preferred package manager or the official Node
    installer, then verify it:

    ```bash
    node -v
    ```

  </TabItem>
</Tabs>

### Install Dependencies

Inside the theme folder, run:

```bash
npm ci
```

This installs the exact versions from `package-lock.json`.

### Start Development

```bash
npm run dev
```

The site runs at `http://localhost:4321`. What `npm run dev` does:

- **Astro:** generates the settings file from `src/config/config.toml`, watches `config.toml` for changes, and starts the site. To use another port, run `npm run dev -- --port 4322`.
- **Tina:** does the same, and also starts the editor at `http://localhost:4321/admin/`. To use another port, set `PORT` in `.env`. `TINA_GRAPHQL_PORT` and `TINA_DATALAYER_PORT` move Tina's own two ports (4001 and 9000).
- **Sanity:** does the same as Astro, and runs straight away with the bundled sample content, with no account. To edit, run `npm run setup` once, then `npm run dev:all`, which starts the site and the Studio at `http://localhost:3333`. `SITE_PORT` and `STUDIO_PORT` in `.env` move their ports.

See [Tina](../../features/tina/) and [Sanity](../../features/sanity/) for the editing guides.

<Aside type="note">
  `npm run dev` starts the `config.toml` watcher and the site together. We have
  not tested it on Windows. If the site doesn't start there, press
  <kbd>Ctrl</kbd> + <kbd>C</kbd> and run the two parts in two terminals: `npm run toml:watch -- --watch`
  in the first, `npx astro dev` in the second.
</Aside>

### Run Quality Checks

```bash
npm run astro-check
```

Run this after you change code or content schemas. In the Tina edition, also run `npm run tina:audit` after you change content files by hand. In the Sanity edition, `npm run sanity:validate` checks the Studio's schema.

### Create A Production Build

```bash
npm run build
```

That sequence:

1. regenerates the settings file from `config.toml`
2. builds the Astro site into `dist/`
3. removes draft pages from the sitemap

In the Sanity edition, the build reads your published content. With no project connected, it uses the bundled sample content. To see the build locally, run `npm run preview`.

### Useful Extra Scripts

```bash
npm run generate-favicons
npm run generate-multilingual-content
npm run remove-multilingual
npm run test
```

- `generate-favicons` rebuilds favicon assets from your source logo.
- `generate-multilingual-content` adds a language. It needs flags: see [Internationalization](../../customization/internationalization/).
- `remove-multilingual` keeps only your default language.
- `test` runs the Jest test suite.