> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/nrwl/nx/llms.txt
> Use this file to discover all available pages before exploring further.

# Installation

> Install Nx globally via npm, Homebrew, Chocolatey, or apt. Add Nx to existing repos with nx init.

## Global installation

Install Nx globally to run commands from anywhere. Choose a method based on your operating system and package manager.

<Tabs>
  <Tab title="npm">
    ```bash theme={null}
    npm add --global nx
    ```

    You can also use `yarn global add nx`, `pnpm add --global nx`, or `bun add --global nx`.
  </Tab>

  <Tab title="Homebrew (macOS, Linux)">
    ```bash theme={null}
    brew install nx
    ```
  </Tab>

  <Tab title="Chocolatey (Windows)">
    ```bash theme={null}
    choco install nx
    ```
  </Tab>

  <Tab title="apt (Ubuntu)">
    ```bash theme={null}
    sudo add-apt-repository ppa:nrwl/nx
    sudo apt update
    sudo apt install nx
    ```
  </Tab>
</Tabs>

### Verify installation

```bash theme={null}
nx --version
```

You should see a version number like `22.5.0`.

### Update global installation

<Tabs>
  <Tab title="npm">
    ```bash theme={null}
    npm update --global nx
    ```

    You can also use `yarn global upgrade nx`, `pnpm update --global nx`, or `bun update --global nx`.
  </Tab>

  <Tab title="Homebrew (macOS, Linux)">
    ```bash theme={null}
    brew upgrade nx
    ```
  </Tab>

  <Tab title="Chocolatey (Windows)">
    ```bash theme={null}
    choco upgrade nx
    ```
  </Tab>

  <Tab title="apt (Ubuntu)">
    ```bash theme={null}
    sudo apt update
    sudo apt upgrade nx
    ```
  </Tab>
</Tabs>

## Install in a repository

To add Nx to an existing repository, run:

```bash theme={null}
npx nx@latest init
```

This installs the `nx` package as a dev dependency and creates an `nx.json` configuration file. If you have Nx installed globally, it will defer to the local version in your repository.

<Note>
  You can also manually install the `nx` npm package and create an `nx.json` configuration file by hand.
</Note>

## Update Nx in your repository

When you update Nx in your repository, it will also automatically update your dependencies if you have an Nx plugin installed for that dependency. To update Nx, run:

```bash theme={null}
nx migrate latest
```

This creates a `migrations.json` file with any update scripts that need to be run. Apply them with:

```bash theme={null}
nx migrate --run-migrations
```

<Warning>
  To avoid potential issues, update one major version of Nx at a time.
</Warning>

## System requirements

Nx is built with Rust for performance and ships precompiled native binaries for the following platforms:

| Platform           | Architectures     |
| ------------------ | ----------------- |
| **Linux (GNU)**    | x64, arm64, armv7 |
| **Linux (musl)**   | x64, arm64        |
| **macOS**          | x64, arm64        |
| **Windows (MSVC)** | x64, arm64        |
| **FreeBSD**        | x64               |

Nx requires **Node.js** (LTS recommended). No other global dependencies are required — Nx manages tooling per project via plugins.
