diff --git a/docs/shared/getting-started/installation.md b/docs/shared/getting-started/installation.md index 7d8886d7b7..f703c34c7a 100644 --- a/docs/shared/getting-started/installation.md +++ b/docs/shared/getting-started/installation.md @@ -77,6 +77,14 @@ You can also manually install the nx NPM package and create a [nx.json](/referen You can install Nx globally. Depending on your package manager, use one of the following commands: {% tabs %} +{% tab label="Homebrew" %} + +```shell +brew tap nrwl/nx +brew install nx +``` + +{% /tab %} {% tab label="npm" %} ```shell diff --git a/docs/shared/recipes/installation/install-non-javascript.md b/docs/shared/recipes/installation/install-non-javascript.md index a3d25ffb34..e8fa9e7e6d 100644 --- a/docs/shared/recipes/installation/install-non-javascript.md +++ b/docs/shared/recipes/installation/install-non-javascript.md @@ -7,12 +7,38 @@ description: Learn how to install and use Nx in repositories that don't contain Nx can manage its own installation without requiring a `package.json` file or a `node_modules` folder. This type of installation is useful for repositories that may not contain any JavaScript or TypeScript (e.g. .Net or Java based workspaces that want to leverage Nx features). In this setup, the Nx CLI is all contained within a `.nx` folder. -## Usage +## Globally Install Nx -You can install Nx in the `.nx/installation` directory by running `nx init` in a directory without a `package.json` file. +First globally install Nx using Homebrew (Mac only) or with a manually installed version of Node (any OS). + +{% tabs %} +{% tab label="Homebrew" %} + +If you have [Homebrew installed](https://brew.sh/), you can install Nx globally with these commands: ```shell -npx nx init +brew tap nrwl/nx +brew install nx +``` + +{% /tab %} +{% tab label="Node" %} + +If you have [Node installed](https://nodejs.org/en/download), you can install Nx globally with this command: + +```shell +npm install --global nx +``` + +{% /tab %} +{% /tabs %} + +## Usage + +You can install Nx in the `.nx/installation` directory of your repository by running `nx init` in a directory without a `package.json` file. + +```shell +nx init ``` When Nx is installed in `.nx`, you can run Nx via a global Nx installation or the nx and nx.bat scripts that were created. In either case, the wrapper (.nx/nxw.js) will be invoked and ensure that the current workspace is up to date prior to invoking Nx. diff --git a/docs/shared/tutorials/gradle.md b/docs/shared/tutorials/gradle.md index bda706e819..c30a9774b2 100644 --- a/docs/shared/tutorials/gradle.md +++ b/docs/shared/tutorials/gradle.md @@ -27,13 +27,30 @@ To verify that Gradle was installed correctly, run this command: gradle --version ``` -Nx also requires NodeJS to be installed. If you do not have NodeJS installed, you can -install it from the [NodeJS website](https://nodejs.org/en/download). +To streamline this tutorial, we'll install Nx globally on your system. You can use Homebrew (Mac only) or a manually installed Node version (any OS). + +{% tabs %} +{% tab label="Homebrew" %} + +Make sure [Homebrew is installed](https://brew.sh/), then install Nx globally with these commands: ```shell -node -v +brew tap nrwl/nx +brew install nx ``` +{% /tab %} +{% tab label="Node" %} + +Install node from the [NodeJS website](https://nodejs.org/en/download), then install Nx globally with this command: + +```shell +npm install --global nx +``` + +{% /tab %} +{% /tabs %} + ## Getting Started This tutorial picks up where [Spring framework](https://spring.io/)'s guide for [Multi-Module Projects](https://spring.io/guides/gs/multi-module) leaves off.