Skip to content

Instantly share code, notes, and snippets.

@Shelrothman
Forked from adcreare/npm-beta-publish.md
Created February 7, 2025 21:19
Show Gist options
  • Save Shelrothman/7d8716937cd6c1a9bd895ed428a8154b to your computer and use it in GitHub Desktop.
Save Shelrothman/7d8716937cd6c1a9bd895ed428a8154b to your computer and use it in GitHub Desktop.
npm publish a beta package

Steps to publish a npm package to beta that won't be available via latest and won't auto install on ncu updates etc

  1. Ensure any compile is run npm run dist etc
  2. Modify version in package.json to the following format (match with existing verion numbers etc) "version": "0.1.120-beta.1" where beta.x is the number of those betas
  3. Publish to npm npm publish --tag beta

There are two options for install:

  • Always install beta with npm install packagename@beta
  • Install specific version with npm install [email protected]

How to fix latest if you publish a beta without --tag beta (if will default to latest) run: npm dist-tags add @COMPANY/[email protected] latest --otp=123456where 1.0.3 is the version that should be latest --otp= is required

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment