DEV Community

Cover image for Yarn + NodeJS LTS with Homebrew
Ilê Caian
Ilê Caian

Posted on • Edited on • Originally published at caian.dev

Yarn + NodeJS LTS with Homebrew

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
$ brew uninstall yarn
$ brew uninstall node
Enter fullscreen mode Exit fullscreen mode
  • Install the latest LTS version of Node
$ brew install node@12
Enter fullscreen mode Exit fullscreen mode
  • Create the Symlink for it
$ ln -s /usr/local/opt/node@12 /usr/local/opt/node
Enter fullscreen mode Exit fullscreen mode
  • Install Yarn without its dependencies
$ brew install yarn --ignore-dependencies
Enter fullscreen mode Exit fullscreen mode

And that's it!

If you want to check the versions of each package, just run

echo "Yarn Version: $(yarn --version)"
echo "Node Version: $(node --version)"
Enter fullscreen mode Exit fullscreen mode

Cover Photo by Sereja Ris on Unsplash

Top comments (3)

Collapse
 
renetillamenva07 profile image
Rene Tillamenva

Hello there

Collapse
 
caiangums profile image
Ilê Caian

Hi! 😄

Collapse
 
renetillamenva07 profile image
Rene Tillamenva

How are you doing