nx/docs/shared/recipes/installation/install-non-javascript.md
Jack Hsu 9be3d20fe3
docs(misc): update installation via Homebrew (#31439)
Now that Nx is merged into
[`homebrew-core`](https://github.com/Homebrew/homebrew-core/pull/225452)
we no longer need to tap to access a non-official formula.

This PR updates our brew install to remove `brew tap nrwl/nx`. It also
mentions Linux for Homebrew since it is supported across different Linux
distros.
2025-06-03 12:08:33 -04:00

1.9 KiB

title description
Install Nx in a Non-JavaScript Repository Learn how to install and use Nx in repositories that don't contain JavaScript or TypeScript code, such as .NET or Java-based workspaces.

Install Nx in a Non-Javascript Repo

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.

Globally Install Nx

First globally install Nx using Homebrew (Mac and Linux) or with a manually installed version of Node (any OS).

{% tabs %} {% tab label="Homebrew" %}

If you have Homebrew installed, you can install Nx globally with these commands:

brew install nx

{% /tab %} {% tab label="Node" %}

If you have Node installed, you can install Nx globally with this command:

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.

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.

{% tabs %} {% tab label="Global Install" %}

nx build my-project
nx generate application
nx graph

{% /tab %} {% tab label="nx shell script" %}

./nx build my-project
./nx generate application
./nx graph

{% /tab %} {% tab label="nx.bat" %}

./nx.bat build my-project
./nx.bat generate application
./nx.bat graph

{% /tab %} {% /tabs %}