Issue in using workspace: protocol in lerna versioning / publish.
See original GitHub issueIssue in using workspace: protocol in lerna versioning.
package A has two dependencies in workspace -> package B , C.
when we modify only package A and trigger lerna version or publish, it fails.
Current Behavior
lerna version / publish throws validation error. To use the ‘workspace:’ protocol, ensure that a package with name “${depName}” exists in the current workspace.
Expected Behavior
Lerna version / publish should succeed.
Steps to Reproduce
package A has two dependencies in workspace -> package B , C
modify only package A and try versioning.
Reason
First time, package graph will have all available workspace packages info in its Map. But after lerna tries to write package json and CHANGELOG, the package graph will only have packages to publish info. so it fails.
// File: package-graph/index.js line:60
Object.keys(graphDependencies).forEach((depName) => {
const depNode = this.get(depName);
// Here , the depNode will not be available.
Environment
(lerna: 5.5.0 => 5.5.0)
Issue Analytics
- State:
- Created a year ago
- Comments:6
Top Results From Across the Web
lerna ERR! TypeError: Cannot read property 'version' of ...
We have the same problem. Tested with both lerna version & lerna publish locally and in our bitbucket pipeline. pnpm -v 7.12.2 pnpm...
Read more >Troubleshooting
This can cause an issue where Lerna will ignore previously published releases which have been manually performed and tagged with the Github web...
Read more >How to keep workspace:* version specifications when ...
The original Lerna does not currently work properly with workspace: protocol (it will throw some errors and overwrite any workspace: ) ...
Read more >Why we stopped using Lerna for monorepos
Lerna will keep the workspace: protocol during versioning, which is fine. When publishing, Lerna invokes npm publish with a non-negotiable ...
Read more >Managing monorepos with Lerna and Yarn workspaces
Lerna and Yarn Workspaces gives us the ability to build and publish libraries and apps in a single repository (a.k.a. Monorepo).
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 FreeTop 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
Top GitHub Comments
@JamesHenry unfortunately, #3322 did not solve this issue soundly, and I’ve met another issue related to this scenario.
Error says the following line in
@lerna/package-graph/index.js
didn’t do nullish check(removed in #3322) before using it:I’ve created a repo to reproduce it: lerna-version-issue
On 5.6.1 the issue remains https://github.com/lerna/lerna/issues/3343