2

I'm trying to install yarn on Ubuntu 18.04 using nvm and npm. The installation succeeds and shows that it's installed globally. The which command points to the right directory as well, but the command can't be used by itself, or as yarn install because the system tries to use /usr/bin/yarn instead.

$ nvm which current
/home/[user]/.nvm/versions/node/v10.16.0/bin/node

$ npm install -g yarn@1.16.0

$ which yarn
/home/[user]/.nvm/versions/node/v10.16.0/bin/yarn

$ yarn
bash: /usr/bin/yarn: No such file or directory

$ echo $PATH
/home/[user]/.nvm/versions/node/v10.16.0/bin:/home/[user]/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/[user]/bin:...
RobC
  • 22,977
  • 20
  • 73
  • 80
Allan Bogh
  • 605
  • 8
  • 15

1 Answers1

9

It turns out the fix is to close the terminal and reopen a new terminal window.

Allan Bogh
  • 605
  • 8
  • 15