DEV Community

loading...
Cover image for Yarn + NodeJS LTS with Homebrew

Yarn + NodeJS LTS with Homebrew

Ilê Caian
I like dogs and music. Eventually I code. 🐶woof!
Originally published at caian.dev Updated on ・1 min read

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

Discussion (3)

Collapse
renetillamenva07 profile image
Rene Tillamenva

Hello there

Collapse
caiangums profile image
Ilê Caian Author

Hi! 😄

Collapse
renetillamenva07 profile image
Rene Tillamenva

How are you doing