Nicolas Nobelis
Nicolas Nobelis

Reputation: 842

How to identify which version of Yarn is used by a project?

For the OSS Review Toolkit project, I would like to identify which version of yarn is used by a given project in a given repository.

Which criteria should be used ? There is:

Is there any other criteria that could be used to disambiguiate if this is a Yarn 1, 2 or 3 project ?

Upvotes: 11

Views: 21976

Answers (2)

badjuice
badjuice

Reputation: 65

In my experience, it shows the version of yarn being run when you perform a yarn command (e.g. yarn install) on a repository.

Terminal output after running yarn install

Upvotes: 0

dylanh724
dylanh724

Reputation: 1018

The frustrating answer is that there isn't an easy way (although there probably should be). Running yarn -v will simply show your global yarn version; not the local repo. You need to look for the same hints you listed.

Perhaps your collaborators can agree to make an arbitrary .yarnver file that simply contains something like:

1.22.11

Upvotes: 5

Related Questions