# V2

Migrate from Doks v1 to v2 with step-by-step dependency, package, and configuration updates, plus fixes for common upgrade issues.

Use this guide to migrate your project from Doks v1 to Doks v2.

## Prerequisites

- [Hugo](https://github.com/gohugoio/hugo/releases/latest) (latest extended or extended/deploy edition)
- [Thulite](https://github.com/thuliteio/thulite/releases/latest) (latest version)
- [Node.js/npm](https://nodejs.org/en/download) (latest LTS version)

## Updating

Follow the steps below to update your project.

{{< steps >}}
{{< step >}}

Remove currently installed dependencies to avoid version conflicts:

{{< tabs "package-manager-1" >}}
{{< tab "npm" >}}

```bash
npm run clean:install
```

{{< /tab >}}
{{< tab "pnpm" >}}

```bash
pnpm run clean:install
```

{{< /tab >}}
{{< tab "Yarn" >}}

```bash
yarn run clean:install
```

{{< /tab >}}
{{< tab "bun" >}}

```bash
bun run clean:install
```

{{< /tab >}}
{{< /tabs >}}

{{< /step >}}
{{< step >}}
Update `package.json`

Replace the contents of your project's `package.json` with the following template:

```json
{
  "name": "thulite-project",
  "version": "0.0.0",
  "description": "Thulite",
  "author": "Thulite",
  "license": "MIT",
  "scripts": {
    "create": "hugo new",
    "dev": "hugo server --disableFastRender --noHTTPCache",
    "format": "prettier **/** -w -c",
    "build": "hugo --minify --gc",
    "preview": "vite preview --outDir public"
  },
  "engines": {
    "node": ">=20.11.0"
  }
}
```

{{< /step >}}
{{< step >}}

Install the latest Doks dependency in your project:

{{< tabs "package-manager-1" >}}
{{< tab "npm" >}}

```bash
npm install @thulite/doks-core@latest
```

{{< /tab >}}
{{< tab "pnpm" >}}

```bash
pnpm install @thulite/doks-core@latest
```

{{< /tab >}}
{{< tab "Yarn" >}}

```bash
yarn add @thulite/doks-core@latest
```

{{< /tab >}}
{{< tab "bun" >}}

```bash
bun add @thulite/doks-core@latest
```

{{< /tab >}}
{{< /tabs >}}

{{< /step >}}
{{< step >}}

Install the latest versions of Prettier and Vite as `devDependencies`:

{{< tabs "package-manager-1" >}}
{{< tab "npm" >}}

```bash
npm install -D prettier@latest vite@latest
```

{{< /tab >}}
{{< tab "pnpm" >}}

```bash
pnpm install -D prettier@latest vite@latest
```

{{< /tab >}}
{{< tab "Yarn" >}}

```bash
yarn add -D prettier@latest vite@latest
```

{{< /tab >}}
{{< tab "bun" >}}

```bash
bun add -d prettier@latest vite@latest
```

{{< /tab >}}
{{< /tabs >}}

{{< /step >}}
{{< step >}}

Optionally, install the recommended integrations in your project:

{{< tabs "package-manager-1" >}}
{{< tab "npm" >}}

```bash
npm install @thulite/seo@latest @thulite/images@latest @thulite/inline-svg@latest
```

{{< /tab >}}
{{< tab "pnpm" >}}

```bash
pnpm install @thulite/seo@latest @thulite/images@latest @thulite/inline-svg@latest
```

{{< /tab >}}
{{< tab "Yarn" >}}

```bash
yarn add @thulite/seo@latest @thulite/images@latest @thulite/inline-svg@latest
```

{{< /tab >}}
{{< tab "bun" >}}

```bash
bun add @thulite/seo@latest @thulite/images@latest @thulite/inline-svg@latest
```

{{< /tab >}}
{{< /tabs >}}

{{< /step >}}
{{< /steps >}}

{{< callout context="note" title="Need to continue?" icon="info-circle" >}}

After upgrading Doks to the latest version, you may not need to make any changes to your project at all!

If you notice errors or unexpected behavior, review the sections below to identify project changes you may still need to make.

{{< /callout >}}
{.mt-5}

## Configuration

Review your project configuration for Doks, Thulite, and the recommended integrations:

- [Doks](/docs/start-here/configuration/)
- [Thulite](https://docs.thulite.io/thulite/start-here/configuration/)
- [SEO](https://docs.thulite.io/seo/start-here/configuration/)
- [Images](https://docs.thulite.io/images/start-here/configuration/)
- [SVG](https://docs.thulite.io/svg/start-here/configuration/)

## Known Issues

### ENOENT

If you get an `ENOENT` error, run the following command:

{{< tabs "package-manager-1" >}}
{{< tab "npm" >}}

```bash
npm run clean:install && npm install
```

{{< /tab >}}
{{< tab "pnpm" >}}

```bash
pnpm run clean:install && pnpm install
```

{{< /tab >}}
{{< tab "Yarn" >}}

```bash
yarn run clean:install && yarn install
```

{{< /tab >}}
{{< tab "bun" >}}

```bash
bun run clean:install && bun install
```

{{< /tab >}}
{{< /tabs >}}
