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

Publish, version, and manage public or scoped packages.

Bump patch version

Increment patch version and create a git tag by default.

bashANYnpmversionpublish
bash
npm version patch
Notes

Increment patch version and create a git tag by default.

Bump minor version

Increment minor version.

bashANYnpmversionpublish
bash
npm version minor
Notes

Increment minor version.

Bump major version

Increment major version.

bashANYnpmversionpublish
bash
npm version major
Notes

Increment major version.

Preview published contents

See which files would go into a package tarball.

bashANYnpmpackpublish
bash
npm pack --dry-run
Notes

See which files would go into a package tarball.

Publish package

Publish the current package to the configured registry.

bashANYnpmpublish
bash
npm publish
Notes

Publish the current package to the configured registry.

Publish a scoped package publicly

Publish a scoped package to the public registry.

bashANYnpmpublishscope
bash
npm publish --access public
Notes

Publish a scoped package to the public registry.

Publish with dist-tag

Publish a prerelease or alternate channel.

bashANYnpmpublishdist-tag
bash
npm publish --tag next
Notes

Publish a prerelease or alternate channel.

Distribution tags

Manage package release channels.

List dist-tags

Show all dist-tags for a package.

bashANYnpmdist-tag
bash
npm dist-tag ls <package>
Notes

Show all dist-tags for a package.

Add a dist-tag

Point a tag like beta at a version.

bashANYnpmdist-tag
bash
npm dist-tag add <package>@<version> beta
Notes

Point a tag like beta at a version.

Remove a dist-tag

Delete a dist-tag from a package.

bashANYnpmdist-tag
bash
npm dist-tag rm <package> beta
Notes

Delete a dist-tag from a package.

Registry auth and account actions

Login and inspect identity against a registry.

Login to registry

Authenticate to a registry.

bashANYnpmloginauth
bash
npm login
Notes

Authenticate to a registry.

Logout from registry

Clear login credentials for the current registry.

bashANYnpmlogoutauth
bash
npm logout
Notes

Clear login credentials for the current registry.

Show current username

Display the authenticated npm username.

bashANYnpmwhoamiauth
bash
npm whoami
Notes

Display the authenticated npm username.

List packages you can access

Show package access rules for the current account.

bashANYnpmaccess
bash
npm access ls-packages
Notes

Show package access rules for the current account.

List package owners

Show owners of a package.

bashANYnpmowner
bash
npm owner ls <package>
Notes

Show owners of a package.

Add a package owner

Grant owner rights on a package.

bashANYnpmowner
bash
npm owner add <user> <package>
Notes

Grant owner rights on a package.

Registry discovery and metadata

Inspect search and package pages.

Open package repository

Open the package repository URL.

bashANYnpmrepo
bash
npm repo <package>
Notes

Open the package repository URL.

Open package homepage

Open a package homepage.

bashANYnpmhome
bash
npm home <package>
Notes

Open a package homepage.

Deprecate a version range

Mark versions as deprecated in the registry.

bashANYnpmdeprecate
bash
npm deprecate <package>@"<range>" "message"
Notes

Mark versions as deprecated in the registry.

Unpublish a package version

Remove a published version, subject to registry rules.

bashANYnpmunpublish
bash
npm unpublish <package>@<version>
Notes

Remove a published version, subject to registry rules.

Recommended next

No recommendations yet.