Keep license reporting scoped to importers recorded in the selected lockfile. An unrecorded workspace package contributes no dependencies; it must not crash or inherit the root importer's dependency list. Require the lockfile in the Rust CLI, matching the existing TypeScript error. Render empty license reports according to the selected output format in both CLIs. Closes pnpm/tasks#174.
1.5 KiB
id, title
| id | title |
|---|---|
| licenses | pnpm licenses |
Commands
list
Aliases: ls
List licenses for installed packages. Terminal table output removes control characters from package metadata. JSON output preserves the metadata.
The command requires a pnpm-lock.yaml file. A workspace project not yet
recorded in the lockfile has no licenses to list. When no licenses match, text
output says No licenses in packages found and --json outputs {}.
Since v11.28.0, running pnpm licenses list inside a workspace package lists only the licenses of that package's dependencies. Use --recursive or --filter to include other workspace projects.
Since v11.20.0, a package resolved from a named registry is reported separately from a package of the same name and version that came from another registry. The registry alias is shown next to the package name in the table output and is exposed as the registryName field with --json.
Options
--recursive, -r
List the licenses of the dependencies of every workspace project.
--dev, -D
Check only "devDependencies".
--json
Show information in JSON format.
--long
Show more details (such as a link to the repo) are not displayed. To display the details, pass this option.
--no-optional
Don't check packages from optionalDependencies.
--prod, -P
Check only dependencies and optionalDependencies.