Skip to content

Instantly share code, notes, and snippets.

@zephraph
Forked from schmich/npm-prerelease.md
Last active September 29, 2023 01:19
Show Gist options
  • Star 8 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save zephraph/d97ce2b42596eb2d57227beeab6315e2 to your computer and use it in GitHub Desktop.
Save zephraph/d97ce2b42596eb2d57227beeab6315e2 to your computer and use it in GitHub Desktop.
Publish a canary package on NPM
  • Update package.json by running yarn version --prerelease --preid=canary
  • Run npm publish --tag canary to publish the package under the canary tag
  • Run yarn add @artsy/reaction@canary to install canary package

Running npm dist-tag ls can be helpful to see what tagged packages are available

@wanjas
Copy link

wanjas commented May 12, 2021

Update of version in package.json also can be automated using npm version prerelease --preid=canary

@dozortsev
Copy link

Yarn command to update version automatically:

yarn version --prerelease --preid=canary

https://classic.yarnpkg.com/en/docs/cli/version/#toc-yarn-version-prerelease

@zephraph
Copy link
Author

zephraph commented Jun 9, 2021

Thanks! I'll update.

@appsparkler
Copy link

This is what I'm using in my scripts:

yarn build && yarn version --prerelease --preid=canary && npm publish --tag canary

Thanks @zephraph

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