---
title: Cài đặt
description: Cách cài đặt i18n-error-base và yêu cầu hoạt động.
---

## Yêu cầu [#requirements]

- Môi trường thực thi có thể xử lý ES module như Node.js
- Yêu cầu `valibot@^1.0.0` dưới dạng peer dependency

`message` tuân theo `lang` từ `getGlobalConfig()` của Valibot.

## Cài đặt [#installation]

```package-install
npm i i18n-error-base
```

Nếu chưa cài Valibot, hãy thêm cùng lúc.

```package-install
npm i valibot
```

:::warning[Lưu ý về peer dependency]
`valibot` không được bundle. Thiếu `valibot@^1.0.0`, import sẽ thất bại.
:::

## Import [#import]

```ts
import { I18nErrorBase, setErrorMessage } from "i18n-error-base";
import type { ErrorMeta, ErrorOptions, I18nErrorBaseParams, MessageFactory } from "i18n-error-base";
```

## Các bước tiếp theo [#next-steps]

Xem [Cách dùng](/i18n-error-base/vi/usage) để biết cách định nghĩa và chuyển đổi cơ bản.
