How can I list all package versions from yarn.lock file in yarn3.x?

687 Views Asked by At

I have several 'latest' and '^x.x.x' packages for a package that's going into maintenance mode. For stability purposes, I'd like to fix all package versions.

After spending some time combing through the yarn.lock file, I noticed multiple versions of individual packages, making this process very cumbersome.

Most other answers refer to a specific package, using yarn list, which doesn't apply to v3+ and yarn why, which applies to individual packages.

1

There are 1 best solutions below

1
Remy On

I didn't find the documentation over at https://yarnpkg.com/ to be particularly helpful (largely down to the UX) but I found the following through yarn help:

yarn info -A --name-only

This prints the name of each package, accompanied by the npm version. This wasn't tested but may also work for yarn2.x