yarnpkg / yarn

The 1.x line is frozen - features and bugfixes now happen on https://github.com/yarnpkg/berry
https://classic.yarnpkg.com
Other
41.44k stars 2.73k forks source link

Yarn list does not display all the parent dependencies/children dependencies #9036

Open amanandhar01 opened 9 months ago

amanandhar01 commented 9 months ago

For example:

when running: yarn list, semver is missing in the dependency tree yo@4.3.1 │ ├─ yeoman-doctor@^5.0.0 │ ├─ yeoman-environment@^3.5.1 │ └─ yosay@^2.0.2

when running: yarn list --pattern yeoman-doctor, yo is not displayed as the parent dependency for yeoman-doctor yarn list v1.22.19 └─ yeoman-doctor@5.0.0

when running yarn list --pattern semver, yo is not displayed as the parent dependency for yeoman-doctor yarn list v1.22.19 └─ yeoman-doctor@5.0.0 ├─ global-agent@2.2.0 │ └─ semver@7.5.4 └─ semver@5.7.2

kailin0512 commented 9 months ago

I faced the similar issue before and this seems to be the tree parsing bug comes from https://github.com/yarnpkg/yarn/blob/master/src/package-hoister.js

Do we have some idea where & how should we make some changes and we can help to contribute and maybe a PR for a fix? @arcanis