npm Publish & Registry

Publishing, versioning, dist-tags, auth, and registry metadata commands.

View
StandardDetailedCompact
Export
Copy the compact sheet, download it, or print it.
Download
`D` dense toggle · `C` copy all
## Publish packages
Bump patch version
npm version patch

# Increment patch version and create a git tag by default.

Bump minor version
npm version minor

# Increment minor version.

Bump major version
npm version major

# Increment major version.

Preview published contents
npm pack --dry-run

# See which files would go into a package tarball.

Publish package
npm publish

# Publish the current package to the configured registry.

Publish a scoped package publicly
npm publish --access public

# Publish a scoped package to the public registry.

Publish with dist-tag
npm publish --tag next

# Publish a prerelease or alternate channel.

## Distribution tags
List dist-tags
npm dist-tag ls <package>

# Show all dist-tags for a package.

Add a dist-tag
npm dist-tag add <package>@<version> beta

# Point a tag like beta at a version.

Remove a dist-tag
npm dist-tag rm <package> beta

# Delete a dist-tag from a package.

## Registry auth and account actions
Login to registry
npm login

# Authenticate to a registry.

Logout from registry
npm logout

# Clear login credentials for the current registry.

Show current username
npm whoami

# Display the authenticated npm username.

List packages you can access
npm access ls-packages

# Show package access rules for the current account.

List package owners
npm owner ls <package>

# Show owners of a package.

Add a package owner
npm owner add <user> <package>

# Grant owner rights on a package.

## Registry discovery and metadata
Open package repository
npm repo <package>

# Open the package repository URL.

Open package homepage
npm home <package>

# Open a package homepage.

Deprecate a version range
npm deprecate <package>@"<range>" "message"

# Mark versions as deprecated in the registry.

Unpublish a package version
npm unpublish <package>@<version>

# Remove a published version, subject to registry rules.

Recommended next

No recommendations yet.