How do you set the yarn version inside the official yarn step?

Hello people,

I’m moving our project from npm to yarn and I want to make sure that bitirise uses the intended yarn version to run the commands. How can you set the yarn version inside the official step? Thank you!

Hello there @lucian.pacurar :wave:

On the MacOS stacks yarn is installed via brew (homebrew), so in case you need the latest version, you can upgrade using brew life this: brew upgrade yarn

Or if you need a specific version, you can switch between versions using brew switch yarn VERSION_NUMBER. If you are unsure, you can then verify the versions available to Homebrew by running: brew list --versions yarn.

You can read a bit more about this in this thread: homebrew - How do I change the version of yarn used? - Stack Overflow

Hope this helps! :slight_smile:

I found another way of doing which is platform agnostic: https://classic.yarnpkg.com/en/docs/cli/policies
The downside is that you have to commit the .yarn folder else the step will crash.
So it would be great if the Bitrise step would incluse the yarn version to use.

Now that brew switch is no longer available, how can you use a specific version of yarn?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.