Lerna throws a error when there is nothing to publish
See original GitHub issueExpected Behavior
Lerna should not throw an error but just log out that there’s nothing to publish and carry on.
Current Behavior
> @ publish /home/ubuntu/apis
> lerna publish --cd-version=patch --yes
lerna info version 2.0.0-rc.4
lerna info current version 1.0.5
lerna info Checking for updated packages...
lerna info Comparing with tag v1.0.5
lerna ERR! initialize Error: No updated packages to publish.
lerna ERR! initialize at PublishCommand.initialize (/home/ubuntu/apis/node_modules/lerna/lib/commands/PublishCommand.js:204:18)
lerna ERR! initialize at PublishCommand._attempt (/home/ubuntu/apis/node_modules/lerna/lib/Command.js:265:21)
lerna ERR! initialize at PublishCommand.runCommand (/home/ubuntu/apis/node_modules/lerna/lib/Command.js:251:12)
lerna ERR! initialize at PublishCommand.run (/home/ubuntu/apis/node_modules/lerna/lib/Command.js:148:12)
lerna ERR! initialize at Object.handler (/home/ubuntu/apis/node_modules/lerna/lib/commands/PublishCommand.js:83:43)
lerna ERR! initialize at Object.self.runCommand (/home/ubuntu/apis/node_modules/lerna/node_modules/yargs/lib/command.js:231:22)
lerna ERR! initialize at Object.Yargs.self._parseArgs (/home/ubuntu/apis/node_modules/lerna/node_modules/yargs/yargs.js:990:30)
lerna ERR! initialize at Object.Yargs.self.parse (/home/ubuntu/apis/node_modules/lerna/node_modules/yargs/yargs.js:533:23)
lerna ERR! initialize at Object.<anonymous> (/home/ubuntu/apis/node_modules/lerna/bin/lerna.js:4:25)
lerna ERR! initialize at Module._compile (module.js:410:26)
lerna ERR! initialize callback with error
lerna ERR! initialize [Error: No updated packages to publish.]
Possible Solution
I’m not sure why this is throwing an error but I think a warning would be enough here.
Steps to Reproduce (for bugs)
- Publish all your unpublished changes.
- Make sure there are no changes when running
lerna updated
. - Run
lerna publish
. - Notice error.
Context
I’m trying to run in a monorepo and don’t wan’t to fail a step because of this.
If there’s a way to check if there’s something to publish or not I could also just do that but couldn’t find anything in the docs. Something like:
lerna there-are-updates && lerna publish
Your Environment
Executable | Version |
---|---|
lerna --version |
2.0.0-beta.38n |
npm --version |
4.2.0 |
yarn --version |
0.23.4 |
node --version |
v7.9.0 |
OS | Version |
---|---|
macOS Sierra | 10.12.4 |
Issue Analytics
- State:
- Created 6 years ago
- Comments:10 (8 by maintainers)
Top Results From Across the Web
Troubleshooting | Lerna
Make sure to commit all the changes you have in your lerna project, before importing any packages using lerna import . Publish Command....
Read more >@lerna/publish | Yarn - Package Manager
Now: lerna publish when there are no updates is a no-op, exiting successfully with a helpful log message; lerna updated when there are...
Read more >How To Set Up GitHub Actions to Publish a Lerna Monorepo
This will throw if authentication is broken lerna publish will push tags for each of your packages, and maybe write to the CHANGELOG.md...
Read more >Fix React Issues in Lerna using Yarn Workspaces
Error thrown when using Lerna to manage a monorepo with ... of the way Lerna manages the packages in our monorepo and there...
Read more >Yarn publish does not work (#121668) · Issues - GitLab
This looks it may be more of an issue with yarn, but I'm creating this ... I can successfully npm publish , but...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Cool! I’ll open up the PR soon™ and will ping you there if I run into any problems 😃
This thread has been automatically locked because there has not been any recent activity after it was closed. Please open a new issue for related bugs.