How to install yarn quickly (macOS)

I was really in hurry to install yarn and start to work, but when I realised that’s not the case i.e we can’t install it in a hurry 😅. So now let me give you a glimpse of doing it.

To install yarn with brew (the best way according to me). Also to mention please read this article completely and know what you are doing.

brew install yarn

This will allow you to install the latest version of yarn via home brew. Also please check whether you have any other yarn versions installed before doing this or else you will be in trouble.

To check the list of versions you have:

brew list --versions yarn

Also unlinking the rest before you install will be a wise choice too. 👍

brew unlink yarn

If you are not the person using brew then you can use the installation script provided.

curl -o- -L | bash

If you want any specific version, then you can mention the version that you need in the script and here you go.

curl -o- -L | bash -s -- --version [version]

And also if you want to switch the versions, then we have solution for that also without using any fancy version manager. Home brew has the support for it. (Make sure you have previous versions or else this will show nothing)

brew switch yarn [old_version]

Note: Please remove the brackets [] while mentioning the versions 😄

If you find this article interesting and useful, Please do give claps and share it with others. Also if you find any flaws in this article please let me know and i would like to make the changes and improve.

Click here to contact me



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store