Skip to content

Instantly share code, notes, and snippets.

@adcreare
Last active April 29, 2024 19:21
Show Gist options
  • Star 34 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save adcreare/00a10f389841dd4c97197608c9b33a7f to your computer and use it in GitHub Desktop.
Save adcreare/00a10f389841dd4c97197608c9b33a7f 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 package@0.1.120-beta.1

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

@gatsbyz
Copy link

gatsbyz commented Aug 20, 2019

#1 should be skipped when using the most recent serve-runtime & serve, since it's all handled in the prepublish scripts now

@pgrever
Copy link

pgrever commented Nov 19, 2020

Just a note, I tried this and was unable to publish until I did an npm login (normally my security is just handled by using a .npmrc file).

@dumsterB
Copy link

how i can delete beta tag from code tab on npm

@ArnaudBuchholz
Copy link

how i can delete beta tag from code tab on npm

I would assume that you republish the package after removing the -beta suffix in the package.json

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