0

Windows Subsystem for Linux (WSL) Ubuntu 18.04

I've got nvm installed and I'm using node v10.24.1, npm v6.14.12, and I'm trying to upgrade yarn from 0.32 to 1.x

When I run npm install -g yarn I get

> yarn@1.22.15 preinstall /home/pmweeks/.nvm/versions/node/v10.24.1/lib/node_modules/yarn
> :; (node ./preinstall.js > /dev/null 2>&1 || true)

/home/pmweeks/.nvm/versions/node/v10.24.1/bin/yarn -> /home/pmweeks/.nvm/versions/node/v10.24.1/lib/node_modules/yarn/bin/yarn.js
/home/pmweeks/.nvm/versions/node/v10.24.1/bin/yarnpkg -> /home/pmweeks/.nvm/versions/node/v10.24.1/lib/node_modules/yarn/bin/yarn.js
+ yarn@1.22.15
updated 1 package in 1.851s

but then I run yarn --version and I get 0.32 still. I can run npm install -g yarn again and it will act like it's upgrading it again.

I've also tried sudo apt install yarn and sudo apt update \ sudo apt upgrade and still I'm on yarn 0.32

How can I upgrade yarn to 1.x with nvm installed? I suspect that the problem is something to do with nvm but I don't want to uninstall or switch node version managers if there's an easier way

Peter Weeks
  • 291
  • 2
  • 16

1 Answers1

0

Managed to get yarn version 1.x installed and working by following the instructions in the top answer to this question

Peter Weeks
  • 291
  • 2
  • 16