This PR makes the global install more prominent. This is important for non-JS workspaces since they may not have node or npm available. The installation flow should be: 1. Install Nx (e.g. `brew install nx`) 2. Run `nx init` in your project The `create-nx-workspace` is removed since it's already mentioned on the intro page, and it is covered in tutorials. It is also not technically an "install" command. Preview: https://nx-dev-git-docs-update-installation-nrwl.vercel.app/getting-started/installation **Note:** The cross-platform NPM install is still featured first because it'll work for everyone. It shouldn't be a concern for non-JS devs since other tools like Claude Code also has `npm install --global` as their install step.
2.6 KiB
| title | description |
|---|---|
| Installation | Learn how to install Nx in a new workspace, add it to an existing repository, install it globally, or set it up in a non-JavaScript repository with step-by-step instructions. |
Installation
To install Nx on your machine, choose one of the following methods based on your operating system and package manager. You can also use npx to run Nx without installing it globally.
{% tabs %} {% tab label="npm" %}
npm add --global nx
Note: You can also use yarn, pnpm, or bun
{% /tab %} {% tab label="Homebrew (macOS, Linux)" %}
brew install nx
{% /tab %} {% tab label="Chocolatey (Windows)" %}
choco install nx
{% /tab %} {% tab label="apt (Ubuntu)" %}
sudo add-apt-repository ppa:nrwl/nx
sudo apt update
sudo apt install nx
{% /tab %} {% /tabs %}
Adding Nx Into Your Repository
To add Nx to an existing repository run:
nx init
Note: You can also manually install the nx NPM package and create a nx.json to configure it. Learn more about adopting Nx in an existing project
Starter Repository
To create a starter repository, you can use the create-nx-workspace command. This will create a new Nx workspace with a default configuration and example applications.
npx create-nx-workspace@latest
Update Nx
When you update Nx, Nx will also automatically update your dependencies if you have an Nx plugin installed for that dependency. To update Nx, run:
nx migrate latest
This will create a migrations.json file with any update scripts that need to be run. Run them with:
nx migrate --run-migrations
{% callout title="Update One Major Version at a Time" %} To avoid potential issues, it is recommended to update one major version of Nx at a time. {% /callout %}
Tutorials
Try one of these tutorials for a full walkthrough of what to do after you install Nx