This has happened to me each time I setup a new Debian or Ubuntu environment. Firstly, the
yarn that was installed or already installed was the one used by the
I thought I had
yarn installed when I checked using the command
which yarn and out printed
$ which yarn /usr/bin/yarn
When I ran
yarn upgrade I got this weird error message:
This seemed strange. Why is
yarn looking for a file or directory called ‘upgrade’. Did I use the wrong option? Is it
I checked the
man page to confirm and then saw the name and realised something is not right. It showed “yarn – scenario testing of Unix command-line tools”.
At this point, it dawned on me that it’s the wrong
This is a known issue in Debian and Debian-based distros, like Ubuntu.
To fix this, we can’t run the command
sudo apt remove yarn because
yarn is not a package. It belongs to the
cmdtest package. So, we have to remove the
cmdtest package instead and then only install the correct
yarn, preferably using
npm install -g yarn.
I hope this helps if you are also facing the same problem.