installing yarn with brew

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?

Upvotes: 2

Views: 6079

Answers (2)

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

source: here

Upvotes: -1

chenrui
chenrui

Reputation: 9866

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

Upvotes: 4

Related Questions