pnpm Publish and Registry

Pack, publish, dist-tags, registries, auth, and package metadata queries.

View
StandardDetailedCompact
Export
Copy the compact sheet, download it, or print it.
Download
`D` dense toggle · `C` copy all

Pack and Publish

Prepare tarballs and publish packages.

Pack current package

Create a tarball from the current package.

bashANYpnpmpackpublish
bash
pnpm pack

Create a tarball from the current package.

Publish current package

Publish the current package to the configured registry.

bashANYpnpmpublishregistry
bash
pnpm publish

Publish the current package to the configured registry.

Publish public scoped package

Publish a scoped package with public visibility.

bashANYpnpmpublishaccess
bash
pnpm publish --access public

Publish a scoped package with public visibility.

Publish under dist-tag

Publish a prerelease or alternate stream under a custom dist-tag.

bashANYpnpmpublishtag
bash
pnpm publish --tag next

Publish a prerelease or alternate stream under a custom dist-tag.

Publish without Git checks

Skip Git checks when necessary, such as in some automated environments.

bashANYpnpmpublishgit
bash
pnpm publish --no-git-checks

Skip Git checks when necessary, such as in some automated environments.

Publish workspace packages recursively

Publish workspace packages recursively.

bashANYpnpmpublishworkspace
bash
pnpm -r publish

Publish workspace packages recursively.

Registry and Authentication

Work with registries and auth tokens.

Login to a registry

Authenticate with the current registry.

bashANYpnpmregistryauth
bash
pnpm login

Authenticate with the current registry.

Logout from a registry

Remove login credentials for the current registry.

bashANYpnpmregistryauth
bash
pnpm logout

Remove login credentials for the current registry.

Show current registry user

Show the account currently authenticated for the active registry.

bashANYpnpmregistryauth
bash
pnpm whoami

Show the account currently authenticated for the active registry.

Set npm registry

Configure the default registry endpoint.

bashANYpnpmregistryconfig
bash
pnpm config set registry https://registry.npmjs.org/

Configure the default registry endpoint.

Set registry for a scope

Send a package scope to a specific registry.

bashANYpnpmregistryscope
bash
pnpm config set @acme:registry https://npm.pkg.github.com

Send a package scope to a specific registry.

Store token in .npmrc

Use an auth token via .npmrc for automated publishing.

bashANYpnpmregistryauthtoken
bash
printf '//registry.npmjs.org/:_authToken=${NPM_TOKEN}
' >> .npmrc

Use an auth token via .npmrc for automated publishing.

Package Metadata and Distribution

Inspect package metadata and dist-tags.

View package metadata

Inspect package metadata from the registry.

bashANYpnpmviewregistry
bash
pnpm view react

Inspect package metadata from the registry.

View package version

Get a specific metadata field from the registry.

bashANYpnpmviewversion
bash
pnpm view react version

Get a specific metadata field from the registry.

Show package info

Query package metadata fields.

bashANYpnpminforegistry
bash
pnpm info react peerDependencies

Query package metadata fields.

Preview publish contents

Preview what would be published without uploading.

bashANYpnpmpublishdry-run
bash
pnpm publish --dry-run

Preview what would be published without uploading.

Pack to destination directory

Write the generated tarball into a chosen directory.

bashANYpnpmpackartifacts
bash
pnpm pack --pack-destination ./artifacts

Write the generated tarball into a chosen directory.

Recommended next

No recommendations yet.