The last Yarn version in Homebrew uses a non-LTS version (
15) of NodeJS as its dependency. If this is an issue for you as it is for me, I just managed to accomplish use Yarn with the latest LTS version of NodeJS.
I created a gist for it and here are the following steps
- Uninstall Yarn and Node
One very convenient way to install Node.js is through a package manager. In this case, every operating system has its own. On macOS, Homebrew is the de-facto standard, and - once installed - allows you to install Node.js very easily, by running this command in the CLI. Homebrew Documentation. Documentation Users. Brew man-page (command documentation); Homebrew Blog (news on major updates) Troubleshooting. [email protected]: 329: Installs on Request (30 days) [email protected]: 254: Build Errors (30 days) [email protected]: 18: Installs (90 days) [email protected]: 841: Installs on Request (90 days) [email protected]: 727: Installs (365 days) [email protected]: 1,533: Installs on Request (365 days) [email protected]: 1,385. However, if you’re a Homebrew fan like me and prefer to install all of your packages with it — ensuring your packages are installed using the same commands and directories and allowing Homebrew to easily manage upgrades and updates — then this guide will help you get started. Install Node.js and npm with Homebrew.
Brew Install Npm
- Install the latest LTS version of Node
- Create the Symlink for it
- Install Yarn without its dependencies
And that’s it!
If you want to check the versions of each package, just run
Homebrew Node Lts
Cover Photo by Sereja Ris on Unsplash