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
Pack current package
pnpm pack

# Create a tarball from the current package.

Publish current package
pnpm publish

# Publish the current package to the configured registry.

Publish public scoped package
pnpm publish --access public

# Publish a scoped package with public visibility.

Publish under dist-tag
pnpm publish --tag next

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

Publish without Git checks
pnpm publish --no-git-checks

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

Publish workspace packages recursively
pnpm -r publish

# Publish workspace packages recursively.

## Registry and Authentication
Login to a registry
pnpm login

# Authenticate with the current registry.

Logout from a registry
pnpm logout

# Remove login credentials for the current registry.

Show current registry user
pnpm whoami

# Show the account currently authenticated for the active registry.

Set npm registry
pnpm config set registry https://registry.npmjs.org/

# Configure the default registry endpoint.

Set registry for a scope
pnpm config set @acme:registry https://npm.pkg.github.com

# Send a package scope to a specific registry.

Store token in .npmrc
printf '//registry.npmjs.org/:_authToken=${NPM_TOKEN}
' >> .npmrc

# Use an auth token via .npmrc for automated publishing.

## Package Metadata and Distribution
View package metadata
pnpm view react

# Inspect package metadata from the registry.

View package version
pnpm view react version

# Get a specific metadata field from the registry.

Show package info
pnpm info react peerDependencies

# Query package metadata fields.

Preview publish contents
pnpm publish --dry-run

# Preview what would be published without uploading.

Pack to destination directory
pnpm pack --pack-destination ./artifacts

# Write the generated tarball into a chosen directory.

Recommended next

No recommendations yet.