Comments (2)
I try to run lerna publish prerelase
in other test repo, and the packages be successful published!
from lerna.
If others encounter the same situation as mine, here is my solution.
What happend?
The demo file structure in my monorepo:
├── lerna.json
├── nx.json
├── package.json
├── packages
│ ├── base
│ ├── is-even
│ └── is-odd
└── yarn.lock
I only want to publish two packages, packages/is-even
and packages/is-odd
. The packages/base
directory contains utility functions and is not intended to be published as a package. Therefore, I have set packages/base
as private:
// packages/base/package.json
{
"private": true,
"description": "Base utils"
}
Another necessary content occur the issue which should know is "workspaces" in my root package.json
:
// package.json
{
"name": "root",
"private": true,
"workspaces": [
"packages/*"
],
"dependencies": {},
"devDependencies": {
"lerna": "^8.0.0",
"nx": "17.2.8"
}
}
Deep dive
Well, I thought lerna would filter and exclude packages/base
first because they are private. Indeed, lerna does do that, but before excluding them, lerna also reads private packages to obtain metadata information. This is because packages/base
matches the definition in the root package.json
under workspaces: ["packages/*"]
. During the metadata reading process, lerna reads the "name" property of sub-packages, and since packages/base
does not define a "name," it leads to the occurrence of this issue.
Solutions
- option 1: add
"name"
property inpackages/base
, or - option 2: update
workspaces: ["packages/is-*"]
in root package.json;
After the update, lerna publish from-package
works properly! 😄
from lerna.
Related Issues (20)
- Package.json workspaces field is being ignored HOT 1
- No GitHub release is created when using a 'tag-version-separator' other than '@' HOT 3
- Can Lerna Update Only the Version in package.json Without Code Changes? HOT 4
- lerna publish: issuing a WARN for private packages do not make sense
- Running `lerna publish` on Github updates `pnpm-lock.yaml` quotes
- Breaking change added to the footer but still minor version release
- lerna success found 0 packages HOT 2
- CVE-2024-28863 - Lerna using a vulnerable version of `tar` HOT 4
- Cannot spot the changed packages correctly when a custom version provided as command parameter
- lerna version --conventional-graduate does not generate correct changelog HOT 3
- Lerna v8.1.2 uses old version of npm-registry-fetch causing vulnerabilities HOT 1
- Lerna doesn't honor `--yes` option
- tar dependency is broken after `npm audit fix` HOT 3
- Lerna creates identical cache records for different cache hashes HOT 2
- `npx lerna` fails to run with `undefined` error HOT 1
- run build cannot find package when "packages" is in the path HOT 1
- Lerna running slow HOT 3
- Latest version with NX 19 is breaking yarn install/add for dependencies HOT 3
- `lerna run` commands hang in `windows-latest` CI jobs HOT 1
- lerna ERR! E409 Failed to save packument. A common cause is if you try to publish a new package before the previous package has been fully processed. HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lerna.