I recently ran into a bug related to a specific version of a dependency. As part of tracking it down, I needed to figure out what version I had installed.
The yarn list
command can
help with this. Without any flags, it will show a tree structure listing every
single dependency and sub-dependency that is installed for your project.
Here is an example of what that looks like restricted to a pattern of jest
.
$ yarn list --pattern jest
yarn list v1.22.10
├─ @testing-library/[email protected]
├─ @types/[email protected]
├─ @types/[email protected]
│ ├─ @jest/[email protected]
│ ├─ @types/[email protected]
│ ├─ [email protected]
│ └─ [email protected]
...
I can look through this list and find the dependency and version of interest.
It's still a lot of results to comb through, so what I like to do instead is
pipe it to fzf
.
$ yarn list | fzf
Then I can interactively narrow down the results with the power of FZF's fuzzy finding functionality.