Skip to content

Instantly share code, notes, and snippets.

Last active June 20, 2023 14:46
  • Star 72 You must be signed in to star a gist
  • Fork 13 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Publish a prerelease package to NPM
  • Update package.json, set version to a prerelease version, e.g. 2.0.0-rc1, 3.1.5-rc4, ...
  • Run npm pack to create package
  • Run npm publish <package>.tgz --tag next to publish the package under the next tag
  • Run npm install --save package@next to install prerelease package
Copy link

LalitKushwah commented Oct 25, 2018

@schmich Why you have used 'rc' ? Can I use anything other like 1.0.0-SNAPSHOT.1, 1.0.0-SNAPSHOT.2, 1.0.0-SNAPSHOT.3 .....

Copy link

Copy link

Valve commented Mar 23, 2020

Great tip, thanks @schmich!

With yarn you can also do in one command:

yarn publish --tag next

If you want to publish a public package, do:

yarn publish --access public --tag next

Copy link

Now you can also do this with npm (v9.4.1 at the time of posting this):

npm publish --tag next

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