-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
--canary results in duplicate package error from npm #1878
Comments
Is the idea that you anticipate that the publish build job will fail in these cases and handle it accordingly? If that's the case I'm still surprised I have not seen other people referencing it |
Ok ignore me, I can no longer reproduce - the number after alpha now seems to be reliably incrementing, so the SHA is not the only point of differentiation. Thanks for your work on lerna! |
If I had to guess, it was perhaps due to missing git history in the CI build ("shallow" clone)? |
@JamesHenry I have same issue as this issue depicts #1893 . |
This is one of those reports where I feel like I must be doing something wrong, because I cannot find anybody else reporting this issue, and I would have thought almost everyone would run into it if they use
--canary
. So I apologize if this is obvious, but I'm stuck 😅Expected Behavior
I have seen it referenced in many comments that
--canary
is intended to be used as a way to publish a version, either nightly or after every commit.I would love to be able to use it in CI on every commit.
Current Behavior
I have been trying to experiment with making it work on every commit, but I seem to be running into the fact that npm strips away the +SHA from the version before publishing it, and so if a commit does not cause a version increase (e.g. build file change, chore etc), the npm publish will fail because the version already exists.
E.g.
Will be published as
0.1.1-alpha.0
. I validated this directly by running npm publish after I had the issue via lerna, npm always removes the "build metadata".Steps to Reproduce (for bugs)
Context
Your Environment
lerna --version
npm --version
node --version
The text was updated successfully, but these errors were encountered: