Open dboulardsc opened 1 month ago
@dboulardsc Sorry to hear that, issues that only happen under some niche circumstances are the worst, because I naturally can't repro either:
Some ideas to try (in order from simplest to most effort, not necessarily most likely to be the reason):
npm ls nx
to check you have 19.5.6 or similar of the nx dependency of lerna installed and not an old versionyarn nx reset
and retrying the commandsyarn
classic altogetherI face the same issue with npm and lerna 8.1.8.
I have two packages (@package/front and @package/back) that both share a dependency (@package/shared)
npx nx graph
shows the dependency relationship, but the command lerna run build --scope @package/back--include-dependencies
does not build my shared dependency.
The output is :
lerna notice cli v8.1.8
lerna notice filter including "@package/back"
lerna notice filter including dependencies
lerna info filter [ '@package/back' ]
> @package/back:build
> build
> nest build
... then fails irremediably
The package.json files are very similar to @dboulardsc 's ones, but the dependencies are declared like this :
"dependencies": {
"@package/shared": "*"
}
The command used to work, and no package.json of the monorepo changed significantly, so I guess that the issue could have appeared in lerna 8.1.8 ?
I'm experiencing the same issue with Node 20.16.0 (via nvm), npm, and Lerna >= 8.1.3.
If I roll back to version 8.1.2, npx lerna list
works again:
npm i -D lerna@latest
npx lerna list
# lerna notice cli v8.1.8
# lerna success found 0 packages
npm i -D lerna@8.1.3
npx lerna list
# lerna notice cli v8.1.3
# lerna success found 0 packages
npm i -D lerna@8.1.2
npx lerna list
# lerna notice cli v8.1.2
# @company/xxx-client
# @company/xxx-server
# lerna success found 2 packages
- client
package.json
{ "name": "@company/xxx-client", "version": "x.x.x" "scripts": { "eslint": "eslint --fix \"src/**/*.ts\" ", ... } }
- server
package.json
{ "name": "@company/xxx-server", "version": "x.x.x", "scripts": { "eslint": "eslint --fix ./src/**/* --ext .ts", ... } }
package.json
{ "name": "@company/xxx", "private": true, "workspaces": [ "server", "client" ], "scripts": { "eslint": "npx lerna run eslint", ... } }
lerna.json
{ "$schema": "node_modules/lerna/schemas/lerna-schema.json", "version": "5.4.1" }
System:
OS: Linux 6.8 Ubuntu 24.04 LTS 24.04 LTS (Noble Numbat)
CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
Binaries:
Node: 20.16.0 - ~/.nvm/versions/node/v20.16.0/bin/node
npm: 10.8.1 - ~/.nvm/versions/node/v20.16.0/bin/npm
Utilities:
Git: 2.43.0 - /usr/bin/git
npmPackages:
lerna: ^8.1.8 => 8.1.8
Current Behavior
Updated from v7 to v8 with the following config
Executing list returns to have found 0 packages. Meanwhile :
yarn workspace info
returns the correct amount of packagesnpx lerna clean
seems to find the various packages to remove the node_modulesyarn cache clean
doesnt change anythingrm ~/.yarn
doesnt change anythingAlso, 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.
root package.json :
first package :
second package :
Failure Logs / Configuration
Environment