Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why doesn't yarn updated when running upgrade?

I'm trying to use latest yarn version after upgrading it.
I've follow over https://yarnpkg.com/en/docs/install#mac-stable instructions, but yarn didn't really upgraded.
After running brew upgrade yarn:

$ brew upgrade yarn
Updating Homebrew...
Error: yarn 1.9.4 already installed

And after running yarn --version:

$ yarn --version
1.9.2

Is there any way to use the latest version?
Although the guide says that brew upgrade yarn should do it automatically..

like image 402
Yinon Avatar asked Aug 14 '18 09:08

Yinon


Video Answer


1 Answers

There's a lengthy thread on Github regarding upgrades; here's what is suggested for HomeBrew:

brew upgrade yarn
brew link --overwrite yarn

Then try yarn -v


If that fails then you could:

First, uninstall brew's yarn:

brew uninstall yarn

Removing yarn binaries manually:

rm -f /usr/local/bin/yarnpkg
rm -f /usr/local/bin/yarn

Remove yarn cache:

rm -rf ${HOME}/.yarn

If you have the following in your .zshrc or .bash_profile, remove it:

export PATH="$PATH:`yarn global bin`"

Install via curl:

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

Make sure there is the following line in your .zshrc or .bash_profile:

export PATH="$HOME/.yarn/bin:$PATH"

↳ Github : yarn update discussion thread

like image 84
l'L'l Avatar answered Sep 22 '22 11:09

l'L'l