2

First using brew, I installed current node LTS which is node@14 right now

Then I symlinked node using brew link --force node@14 since LTS versions are keg-only

Then I installed yarn with brew install yarn but for some reason brew installed node@15 and after that installed yarn. brew list result shows node and node@14, the former appeared after installing yarn. Now my current node version shows node@15.

I want to use node LTS version and would also like yarn use that version. How do I do it?

2 Answers2

4

homebrew is not a good solution for managing multiple versions of node runtime due to the fact that homebrew is always built with the latest node (in this case, node@15). As result, the package bundle can be shipped together.

Here might be the solution:

  • brew install node@14
  • configure PATH for node@14
  • install yarn with npm
chenrui
  • 8,910
  • 3
  • 33
  • 43
-1

Creating a directory and linking desired version of node to that directory and installing yarn with --ignore-dependencies solved my problem

source: here

  • Additional reference with steps & commands: https://dev.to/caiangums/yarn-nodejs-lts-with-homebrew-1256 – Codi Sep 08 '21 at 09:26