Yinon
Yinon

Reputation: 955

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..

Upvotes: 8

Views: 6663

Answers (2)

jcollum
jcollum

Reputation: 46569

If you installed yarn with npm in an nvm environment then you can just run npm -g upgrade yarn. To check that run which yarn -- if you see .nvm in the result of that, you are in an nvm environment.

Upvotes: 0

l'L'l
l'L'l

Reputation: 47159

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

Upvotes: 21

Related Questions