diff --git a/docs/shared/getting-started/installation.md b/docs/shared/getting-started/installation.md index add5e7732f324..2c39ead466201 100644 --- a/docs/shared/getting-started/installation.md +++ b/docs/shared/getting-started/installation.md @@ -90,7 +90,48 @@ pnpm add --global nx@latest The advantage of a global installation is that you don't have to prefix your commands with npx, yarn or pnpm. The global Nx installation hands off the process execution to the local Nx installation in your repository, which eliminates any issues with outdated globally installed packages. +## 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. To set this up run the `nx init` command in a folder without a `package.json` file. + +```shell +npx nx init +``` + +See the [install Nx in a non-javascript repo](/recipes/installation/install-non-javascript) recipe for more information. + +## Update Nx + +When you update Nx, Nx will also [automatically update your dependencies](/features/automate-updating-dependencies) if you have an [Nx plugin](/concepts/nx-plugins) installed for that dependency. To update Nx, run: + +```shell +npx nx migrate latest +``` + +This will create a `migrations.json` file with any update scripts that need to be run. Run them with: + +```shell +npx 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 + +- [NPM Workspaces Tutorial](/getting-started/tutorials/npm-workspaces-tutorial) +- [Single React App Tutorial](/getting-started/tutorials/react-standalone-tutorial) +- [Single Angular App Tutorial](/getting-started/tutorials/angular-standalone-tutorial) +- [Single Vue App Tutorial](/getting-started/tutorials/vue-standalone-tutorial) +- [React Monorepo Tutorial](/getting-started/tutorials/react-standalone-tutorial) +- [Angular Monorepo Tutorial](/getting-started/tutorials/angular-standalone-tutorial) + ## More Documentation +- [Add Nx to an Existing Repository](/recipes/adopting-nx) +- [Update Nx](/features/automate-updating-dependencies) - [Update Your Global Nx Installation](/recipes/installation/update-global-installation) - [Install Nx in a Non-Javascript Repo](/recipes/installation/install-non-javascript) diff --git a/docs/shared/recipes/installation/install-non-javascript.md b/docs/shared/recipes/installation/install-non-javascript.md index 3964fa17457e4..ba5baf86123e7 100644 --- a/docs/shared/recipes/installation/install-non-javascript.md +++ b/docs/shared/recipes/installation/install-non-javascript.md @@ -4,7 +4,11 @@ Nx can manage its own installation without requiring a `package.json` file or a ## Usage -You can install Nx in the `.nx/installation` directory by running `nx init` in a directory without package.json, and picking to install Nx in the current directory. +You can install Nx in the `.nx/installation` directory by running `nx init` in a directory without a `package.json` file. + +```shell +npx 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. @@ -12,27 +16,27 @@ When Nx is installed in `.nx`, you can run Nx via a global Nx installation or th {% tab label="Global Install" %} ```shell -> nx build my-project -> nx generate application -> nx graph +nx build my-project +nx generate application +nx graph ``` {% /tab %} {% tab label="nx shell script" %} ```shell -> ./nx build my-project -> ./nx generate application -> ./nx graph +./nx build my-project +./nx generate application +./nx graph ``` {% /tab %} {% tab label="nx.bat" %} ```shell -> ./nx.bat build my-project -> ./nx.bat generate application -> ./nx.bat graph +./nx.bat build my-project +./nx.bat generate application +./nx.bat graph ``` {% /tab %}