l_7acq
Last Updated: December 26, 2018
·
15.31K
· DamonOehlman

Publish Beta Versions of NPM Modules

This is something that I have been meaning to find out how to do for a while, and I managed to find a reference to an old tweet between @isaacs and @maccman. Sure enough it's quite simple.

If you want to publish a version of your module under a tag other than latest (which is what is used by default), then simply include the --tag option when publishing with the name of the tag you wish to use (in this case beta)

npm publish --tag beta

And that's it. The version you have just published will be registered under the beta tag rather than the latest tag, and will not be installed when someone attempts to install your package with the npm install <packagename> command.

Of course this technique is not limited to just publishing beta versions of modules, but it's the most obvious case that I'll be using it for.

3 Responses
Add your response

1368

Nice one. Added to the cheat sheet: https://coderwall.com/p/f2btqa

over 1 year ago ·
16188

Exactly what I was looking for !!!

over 1 year ago ·
22178

.. how can I remove a published tag?

over 1 year ago ·