Publish a npm package to beta

24 Jan 2021 1 min

Recently, I was writing one small npm package library for myself and I need to publish it as a beta for testing purpose. Although, we can test it locally using npm link, here’s how we can publish beta version of npm package.

  1. Build your distribution packages for beta publication.
  2. Run npm version prerelease to tag a version as prerelease.
  3. run npm publish --tag beta to publish it as beta.

Here are two options for install:

  1. Always install beta with npm install [email protected]
  2. Install specific version with npm install [email protected]