lerna: Fails on npm publish leaves the repository on a inconsistent state
Hello,
When you do lerna publish, several good things happens:
- Version is bumped on modified packages
- Github tags are added and committed
- Packages are published to npm
If this last step fails, then you are not able to republish the packages you were trying to publish. If you run lerna publish again, it raises an error about no packages has changed
. You have to go to each package manually and run npm publish.
Is there any better approach? Regards
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 8
- Comments: 17 (11 by maintainers)
@noherczeg I have re-read my answer and it was not very polite. I take for granted that every answer has good intention. It was my fault to answer you so impolitely, and I’m sorry about it. Please accept my apologies.
I’ve faced the same issue several times. The problems are that after a failed
npm publish
:Ideally, lerna would delete the publish commit and all the tags, allowing the publish step to be run again. OR it would have an option to continue from where it failed before.
However, in the meantime you can use this:
lerna publish from-git
will restart the publish if the previous execution pushed upstream successfully but then failed during the upload to the registry. YMMV.