Subcommands48 subcommands
pnpm add
Installs a package and any packages that it depends on. By default, any new package is installed as a production dependency
pnpm install
Pnpm install is used to install all dependencies for a project.
In a CI environment, installation fails if a lockfile is present but needs an update.
Inside a workspace, pnpm install installs all dependencies in all the projects.
If you want to disable this behavior, set the recursive-install setting to false
pnpm install-test
Runs pnpm install followed immediately by pnpm test. It takes exactly the same arguments as pnpm install
pnpm update
Pnpm update updates packages to their latest version based on the specified range.
When used without arguments, updates all dependencies. You can use patterns to update specific dependencies
pnpm remove
Removes packages from node_modules and from the project's package.json
pnpm link
Makes the current local package accessible system-wide, or in another location
pnpm unlink
Unlinks a system-wide package (inverse of pnpm link).
If called without arguments, all linked dependencies will be unlinked.
This is similar to yarn unlink, except pnpm re-installs the dependency after removing the external link
pnpm import
Pnpm import generates a pnpm-lock.yaml from an npm package-lock.json (or npm-shrinkwrap.json) file
pnpm rebuild
Rebuild a package
pnpm prune
Removes unnecessary packages
pnpm fetch
EXPERIMENTAL FEATURE: Fetch packages from a lockfile into virtual store, package manifest is ignored: https://pnpm.io/cli/fetch
pnpm patch
This command will cause a package to be extracted in a temporary directory intended to be editable at will
pnpm patch-commit
Generate a patch out of a directory
pnpm audit
Checks for known security issues with the installed packages.
If security issues are found, try to update your dependencies via pnpm update.
If a simple update does not fix all the issues, use overrides to force versions that are not vulnerable.
For instance, if lodash@<2.1.0 is vulnerable, use overrides to force lodash@^2.1.0.
Details at: https://pnpm.io/cli/audit
pnpm list
This command will output all the versions of packages that are installed, as well as their dependencies, in a tree-structure.
Positional arguments are name-pattern@version-range identifiers, which will limit the results to only the packages named. For example, pnpm list "babel-*" "eslint-*" semver@5
pnpm outdated
Checks for outdated packages. The check can be limited to a subset of the installed packages by providing arguments (patterns are supported)
pnpm why
Shows all packages that depend on the specified package
pnpm run
Runs a script defined in the package's manifest file
pnpm exec
Execute a shell command in scope of a project.
node_modules/.bin is added to the PATH, so pnpm exec allows executing commands of dependencies
pnpm test
Runs an arbitrary command specified in the package's test property of its scripts object.
The intended usage of the property is to specify a command that runs unit or integration testing for your program
pnpm start
Runs an arbitrary command specified in the package's start property of its scripts object. If no start property is specified on the scripts object, it will attempt to run node server.js as a default, failing if neither are present.
The intended usage of the property is to specify a command that starts your program
pnpm publish
Publishes a package to the registry.
When publishing a package inside a workspace, the LICENSE file from the root of the workspace is packed with the package (unless the package has a license of its own).
You may override some fields before publish, using the publishConfig field in package.json. You also can use the publishConfig.directory to customize the published subdirectory (usually using third party build tools).
When running this command recursively (pnpm -r publish), pnpm will publish all the packages that have versions not yet published to the registry
pnpm recursive
Runs a pnpm command recursively on all subdirectories in the package or every available workspace
pnpm recursive add
Installs a package and any packages that it depends on. By default, any new package is installed as a production dependency
pnpm recursive install
Pnpm install is used to install all dependencies for a project.
In a CI environment, installation fails if a lockfile is present but needs an update.
Inside a workspace, pnpm install installs all dependencies in all the projects.
If you want to disable this behavior, set the recursive-install setting to false
pnpm recursive update
Pnpm update updates packages to their latest version based on the specified range.
When used without arguments, updates all dependencies. You can use patterns to update specific dependencies
pnpm recursive remove
Removes packages from node_modules and from the project's package.json
pnpm recursive unlink
Unlinks a system-wide package (inverse of pnpm link).
If called without arguments, all linked dependencies will be unlinked.
This is similar to yarn unlink, except pnpm re-installs the dependency after removing the external link
pnpm recursive rebuild
Rebuild a package
pnpm recursive list
This command will output all the versions of packages that are installed, as well as their dependencies, in a tree-structure.
Positional arguments are name-pattern@version-range identifiers, which will limit the results to only the packages named. For example, pnpm list "babel-*" "eslint-*" semver@5
pnpm recursive outdated
Checks for outdated packages. The check can be limited to a subset of the installed packages by providing arguments (patterns are supported)
pnpm recursive why
Shows all packages that depend on the specified package
pnpm recursive run
Runs a script defined in the package's manifest file
pnpm recursive exec
Execute a shell command in scope of a project.
node_modules/.bin is added to the PATH, so pnpm exec allows executing commands of dependencies
pnpm recursive test
Runs an arbitrary command specified in the package's test property of its scripts object.
The intended usage of the property is to specify a command that runs unit or integration testing for your program
pnpm recursive publish
Publishes a package to the registry.
When publishing a package inside a workspace, the LICENSE file from the root of the workspace is packed with the package (unless the package has a license of its own).
You may override some fields before publish, using the publishConfig field in package.json. You also can use the publishConfig.directory to customize the published subdirectory (usually using third party build tools).
When running this command recursively (pnpm -r publish), pnpm will publish all the packages that have versions not yet published to the registry
pnpm server
Manage a store server
pnpm server start
Starts a server that performs all interactions with the store. Other commands will delegate any store-related tasks to this server
pnpm server stop
Stops the store server
pnpm server status
Prints information about the running server
pnpm store
Managing the package store
pnpm store status
Checks for modified packages in the store.
Returns exit code 0 if the content of the package is the same as it was at the time of unpacking
pnpm store add
Functionally equivalent to pnpm add,
except this adds new packages to the store directly without modifying any projects or files outside of the store
pnpm store prune
Removes orphan packages from the store.
Pruning the store will save disk space, however may slow down future installations involving pruned packages.
Ultimately, it is a safe operation, however not recommended if you have orphaned packages from a package you intend to reinstall.
Please read the FAQ for more information on unreferenced packages and best practices.
Please note that this is prohibited when a store server is running
pnpm store path
Returns the path to the active store directory
pnpm init
Creates a basic package.json file in the current directory, if it doesn't exist already
pnpm doctor
Checks for known common issues with pnpm configuration