Skip to main content
Version: 4.x

pnpm publish

Publishes a package to the registry.

pnpm [-r] publish [<tarball>|<folder>] [--tag <tag>] [--access <public|restricted>]

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.

When running this command recursively (pnpm -r publish), pnpm will publish all the packages that have versions not yet published to the registry.


--tag <tag>#

Publishes the package with the given tag. By default, pnpm publish updates the latest tag.

For example:

# inside the foo package directorypnpm publish --tag next# in a project where you want to use the next version of foopnpm add [email protected]

--access <public|restricted>#

Tells the registry whether the published package should be public or restricted.

--filter <package_selector>#

Added in: 4.6.0

Read more about filtering.