Lerna seems to not found packages after upgrade
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 36.1k
- Forks
- 2.3k
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 50
Description
Current Behavior
Updated from v7 to v8 with the following config
{
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"version": "1.0.0",
"npmClient": "yarn"
}
Executing list returns to have found 0 packages.
Meanwhile :
- Occurs only on this very computer. My other one is okay with the upgrade. Also ok for every other colleague in my team. Also ok for github ci/cd.
yarn workspace inforeturns the correct amount of packagesnpx lerna cleanseems to find the various packages to remove the node_modules- Tried on a new-from-scratch project and same behaviour.
- Manually adding packages in lerna.json or root package.json doesnt change anything
yarn cache cleandoesnt change anythingrm ~/.yarndoesnt change anything
Also, seems quite linked to https://github.com/lerna/lerna/issues/4018
Expected Behavior
List the packages my monorepo contains.
Steps to Reproduce
Started a project from scratch and can reproduce the issue.
- yarn init
- yarn add lerna
- lerna init
- mkdir packages
- lerna create patata
- lerna create patato
root package.json :
{
"private": true,
"workspaces": [
"packages/*"
],
"name": "lernatest",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"dependencies": {
"lerna": "^8.1.7"
}
}
first package :
{
"name": "patata",
"version": "1.0.0",
"main": "lib/patata.js",
"scripts": {
"build": "echo \"build patata\""
},
"dependencies": {
"patato": "1.0.0"
}
}
second package :
{
"name": "patato",
"version": "1.0.0",
"main": "lib/patato.js",
"scripts": {
"build": "echo \"build patato\""
}
}
Failure Logs / Configuration
{
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"version": "1.0.0",
"npmClient": "yarn"
}
Environment
lerna notice cli v8.1.7
Environment info:
System:
OS: Linux 5.15 Manjaro Linux
CPU: (8) x64 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz
Binaries:
Node: 20.16.0 - ~/.nvm/versions/node/v20.16.0/bin/node
Yarn: 1.22.22 - /usr/bin/yarn
npm: 10.8.1 - ~/.nvm/versions/node/v20.16.0/bin/npm
Utilities:
Git: 2.45.2 - /usr/bin/git
npmPackages:
lerna: ^8.1.7 => 8.1.7
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the minimal project with Yarn 1.22.22, Node 20.16.0, and Lerna 8.1.7 using the listed initialization commands. Compare Lerna's package listing with yarn workspace info, then trace the package-discovery entry point; done means the two created packages are listed consistently.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- node.js, typescript
- Domain
- build-system, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100