pnpm add <package...>
Installs a package and any packages that it depends on. By default, any new package is installed as a production dependency
Arguments
Options
Name | Description |
---|
--offline | If true, pnpm will use only packages already available in the store. If a package won't be found locally, the installation will fail |
--prefer-offline | If true, staleness checks for cached data will be bypassed, but missing data will be requested from the server. To force full offline mode, use --offline |
--ignore-scripts | Do not execute any scripts defined in the project package.json and its dependencies |
--reporter <Reporter Type> | Allows you to choose the reporter that will log debug info to the terminal about the installation progress |
-P, --save-prod | Install the specified packages as regular dependencies |
-D, --save-dev | Install the specified packages as devDependencies |
-O, --save-optional | Install the specified packages as optionalDependencies |
--no-save | Prevents saving to `dependencies` |
-E, --save-exact | Saved dependencies will be configured with an exact version rather than using pnpm's default semver range operator |
--save-peer | Using --save-peer will add one or more packages to peerDependencies and install them as dev dependencies |
--ignore-workspace-root-check, -W# | Adding a new dependency to the root workspace package fails, unless the --ignore-workspace-root-check or -W flag is used.
For instance, pnpm add debug -W |
--global, -g | Install a package globally |
--workspace | Only adds the new dependency if it is found in the workspace |
--filter <Filepath / Package> | Filtering allows you to restrict commands to specific subsets of packages.
pnpm supports a rich selector syntax for picking packages by name or by relation.
More details: https://pnpm.io/filtering |