# Source: https://stately.ai/docs/installation.mdx

# Installation (/docs/installation)
XState has **zero dependencies** and runs anywhere that JavaScript runs. You can install XState using your favorite package manager, like [npm](https://www.npmjs.com/), [pnpm](https://pnpm.js.org/), or [yarn](https://yarnpkg.com/).

<Tabs items={['npm', 'pnpm', 'yarn']}>
  <Tab value="npm" label="npm">
    ```bash
    npm install xstate
    ```
  </Tab>

  <Tab value="pnpm" label="pnpm">
    ```bash
    pnpm install xstate
    ```
  </Tab>

  <Tab value="yarn" label="yarn">
    ```bash
    yarn add xstate
    ```
  </Tab>
</Tabs>

## CDN

You can also import XState from various CDNs:

* [esm.run](https://esm.run):

```ts
import { createMachine, createActor } from 'https://esm.run/xstate';
```

* [esm.sh](https://esm.sh):

```ts
import { createMachine, createActor } from 'https://esm.sh/xstate';
```

* [Skypack](https://www.skypack.dev):

```ts
import { createMachine, createActor } from 'https://cdn.skypack.dev/xstate';
```