hyperlinkhomebrewyarnpkg

install yarn getting 'brew link node'


When I tried to install yarn via home brew. Got the following message

My-MacBook-Pro:share gt$ brew install yarn
Error: You must `brew link node` before yarn can be installed
My-MacBook-Pro:share gt$ 

running brew link node resulting in

My-MacBook-Pro:share gt$ brew link node
Linking /usr/local/Cellar/node/7.6.0... 
Error: Could not symlink bin/node
Target /usr/local/bin/node
already exists. You may want to remove it:
  rm '/usr/local/bin/node'

To force the link and overwrite all conflicting files:
  brew link --overwrite node

To list all files that would be deleted:
  brew link --overwrite --dry-run node
My-MacBook-Pro:share gt$ 

So I tried the overwrite option

My-MacBook-Pro:share gt$ brew link --overwrite node
Linking /usr/local/Cellar/node/7.6.0... 
Error: Could not symlink share/doc/node/gdbinit
/usr/local/share/doc/node is not writable.
My-MacBook-Pro:share gt$ 

did a chmod on /usr/local/share, then it complains /usr/local/lib/dtrace is not writable

Am I on the right path or just a rabbit hole ? What would be a clean way of installing yarn ?


Solution

  • One of the easiest ways to install Yarn on macOS and generic Unix environments is via our shell script. You can install Yarn by running the following code in your terminal:

    curl -o- -L https://yarnpkg.com/install.sh | bash