add
Install a plugin and initialize it.
Usage
โฏ
nx add <packageSpecifier>
Install nx globally to invoke the command directly using nx, or use npx nx, yarn nx, or pnpm nx.
Examples
Install the @nx/react package matching the installed version of the nx package and run its @nx/react:init generator:
โฏ
nx add @nx/react
Install the latest version of the non-core-nx-plugin package and run its non-core-nx-plugin:init generator if available:
โฏ
nx add non-core-nx-plugin
Install version 17.0.0 of the @nx/react package and run its @nx/react:init generator:
โฏ
nx add @nx/react@17.0.0
Options
| Option | Type | Description | 
|---|---|---|
| --help | boolean | Show help. | 
| --packageSpecifier | string | The package name and optional version (e.g. @nx/reactor@nx/react@latest) to install and initialize. If the version is not specified it will install the same version as thenxpackage for Nx core plugins or the latest version for other packages. | 
| --updatePackageScripts | boolean | Update package.jsonscripts with inferred targets. Defaults totruewhen the package is a core Nx plugin. | 
| --verbose | boolean | Prints additional information about the commands (e.g., stack traces). | 
| --version | boolean | Show version number. |