npm install -g nx@latest
------------------------------------
Installing Nx Globally
You can install Nx globally. Depending on your package manager, use one of the following commands:
npm 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.
npx nx init
See the install Nx in a non-javascript repo recipe for more information.
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:
npx nx migrate latest
This will create a migrations.json
file with any update scripts that need to be run. Run them with:
npx nx migrate --run-migrations
To avoid potential issues, it is recommended to update one major version of Nx at a time.
Tutorials.
Try one of these tutorials for a full walkthrough of what to do after you install Nx
- NPM Workspaces Tutorial
- Single React App Tutorial
- Single Angular App Tutorial
- Single Vue App Tutorial
- React Monorepo Tutorial
- Angular Monorepo Tutorial
More Documentation
- Add Nx to an Existing Repository
- Update Nx
- Update Your Global Nx Installation
- Install Nx in a Non-Javascript Repo
from https://nx.dev/getting-started/installation
-------------------------
Smart Monorepos · Fast CI
Nx is a build system, optimized for monorepos, with plugins for popular frameworks and tools and advanced CI capabilities including caching and distribution.
Create a new Nx workspace with
npx create-nx-workspace
...or run
npx nx init
to add Nx to your existing workspace to get faster task scheduling, caching and more. More in the docs.
Nx Cloud connects directly to your existing CI setup, helping you scale your monorepos on CI by leveraging remote caching, task distribution across multiple machines, automated e2e test splitting and automated task flakiness detection
Connect your existing Nx workspace with
npx nx connect
Learn more in the Nx CI docs »
from https://github.com/nrwl/nx
No comments:
Post a Comment