Do you want to request a feature or report a bug?
bug
What is the current behavior?
Doesn't correctly show where a dep is coming from.
Joes-MacBook-Pro:react-scripts joe$ yarn list loader-utils
yarn list v0.21.3
ββ [email protected]
β ββ [email protected]
ββ [email protected]
β ββ [email protected]
ββ [email protected]
If the current behavior is a bug, please provide the steps to reproduce.
What is the expected behavior?
Joes-MacBook-Pro:react-scripts joe$ npm ls loader-utils
[email protected] /Users/joe/Documents/Development/OSS/create-react-app/packages/react-scripts
βββ¬ [email protected]
β βββ [email protected]
βββ¬ [email protected]
β βββ [email protected]
βββ¬ [email protected]
βββ [email protected]
Please mention your node.js, yarn and operating system version.
Joes-MacBook-Pro:react-scripts joe$ node -v
v6.10.0
Joes-MacBook-Pro:react-scripts joe$ npm -v
3.10.10
Joes-MacBook-Pro:react-scripts joe$ yarn --version
0.21.3
Also, it doesn't seem to have a way to list the production-only dependencies of the project. No matter if prior to running yarn list
you've only run yarn install -production
or even more ideally it would work to run yarn list --production
regardless of what was installed, like works with npm.
I stumbled upon these differences as well.
I would also like yarn to copy the npm ls
format.
It is prettier, more effective and more useful (IMHO;)
yarn list --depth=0
should just list the production (top level) packages. like npm ls
does.
maybe have a yarn list --flat
do the current bahaviour.
but i like the coloring, to be fair :-)
Still an issue:
$ npm list postcss-reporter
[email protected] /path/to/project
βββ¬ [email protected]
βββ [email protected]
$ yarn list postcss-reporter
yarn list v1.0.1
ββ [email protected]
β¨ Done in 0.71s.
Tested on my repo:
https://github.com/alexilyaev/react-es6-starter
I can repro this by creating a set of bogus nested packages. I see that the output depends on how you install it.
If you install the package through npm then npm will show you the tree while yarn does not.
When you install it through yarn then both engines show the same flat tree (and then npm displays warnings about packages being extraneous).
I can try to fix this but something tells me this is working as intended as a side effect of how yarn organizes packages.
Please discuss the best way to resolve this ticket.
I put the example up here:
https://github.com/qfox/yarn/tree/list-yarn-vs-npm/__tests__/fixtures/list/match-npm
And actually, yarn list level5
doesn't even work unless you have installed the package with yarn. I think it reads the information from the yarn.lock
file either way. It will bail the list
command if that file doesn't exist.
Even when you install with Yarn only, npm list
shows a tree whereas yarn list
shows a flat list (which is quite useless).
Example:
https://github.com/alexilyaev/react-es6-starter
$ yarn list wrappy
yarn list v1.2.1
warning Filtering by arguments is deprecated. Please use the pattern option instead.
ββ [email protected]
β¨ Done in 0.63s.
$ npm list wrappy
[email protected] /Users/alex/www/Node/Personal/react-es6-starter
βββ¬ [email protected]
β βββ¬ [email protected]
β βββ¬ [email protected]
β β βββ [email protected]
β βββ¬ [email protected]
β βββ [email protected] deduped
βββ¬ [email protected]
βββ¬ [email protected]
βββ¬ [email protected]
βββ¬ [email protected]
βββ¬ [email protected]
β βββ¬ [email protected]
β βββ¬ [email protected]
β βββ [email protected] deduped
βββ¬ [email protected]
βββ¬ [email protected]
βββ [email protected]
What's up with the warning of using a filter?
Do I have to use yarn list --pattern wrappy
now?
Why make life harder?!
Any workaround for finding that information besides manually tracking down dependencies :(
edit: I guess if you're desperate like me and have too many dependencies to do manually you can blow away yarn.lock and generate the the package-lock.json. I also had to delete my .npmrc file which was supressing the generation of the package-lock.json.
I could't find the --pattern option. Why you show that warning? --cache-folder
, --focus
, --no-progress
other are "very important" options, but the most popular without any manuals is just yarn list package
.
Most helpful comment
Even when you install with Yarn only,
npm list
shows a tree whereasyarn list
shows a flat list (which is quite useless).Example:
https://github.com/alexilyaev/react-es6-starter
P.S.
What's up with the warning of using a filter?
Do I have to use
yarn list --pattern wrappy
now?Why make life harder?!