Yarn ERROR: There are no scenarios; must have at least one

58,767

Solution 1

It looks like that I was trying to execute the wrong yarn, because simply running sudo apt install yarn on my Ubuntu 18.04 gave me yarn from cmdtest.

So I solved by uninstalling it:

sudo apt remove yarn

And by installing it as the official website explains, which in my case (Ubuntu 18.04) it was the following:

curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt update && sudo apt install yarn
yarn

Solution 2

You've got the wrong yarn. The yarn you're executing comes from the cmdtest package. Uninstalling cmdtest first should fix this:

sudo apt remove cmdtest

Once you've uninstalled it, run the commands below to install yarn properly:

curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt update
sudo apt install yarn

Solution 3

The real name you should use when installing is yarnpkg

sudo apt install yarnpkg

That is the solution.

Solution 4

Try this step by step. This worked for me.

sudo apt remove yarn
sudo apt install curl
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt update
sudo apt install yarn

Solution 5

sudo npm install -g yarn

then open a new terminal window and type "yarn --version"

Share:
58,767
Francesco Borzi
Author by

Francesco Borzi

https://github.com/FrancescoBorzi

Updated on February 16, 2022

Comments

  • Francesco Borzi
    Francesco Borzi 9 months

    I tried to install Yarn and when I used the yarn command I got:

    00h00m00s 0/0: : ERROR: There are no scenarios; must have at least one.
    

    my yarn --version is 0.32. Why doesn't it work?

  • Simply Ged
    Simply Ged over 3 years
    When posting an answer, please explain what was wrong and how the answer fixes the issue.
  • parsley72
    parsley72 over 2 years
    I found sudo apt remove yarn didn't do anything, I had to use sudo apt remove cmdtest
  • tibasce
    tibasce almost 2 years
    I'm using Mint 20. I've tried other solutions, but only that one worked for me. Thanks! But I still got some errors while loading these commands: E: The repository 'apt.postgresql.org/pub/repos/apt ulyana-pgdg Release' does not have a Release file. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details. E: The repository 'download.docker.com/linux/ubuntu ulyana Release' does not have a Release file.
  • Anshuman Kumar
    Anshuman Kumar almost 2 years
    For me, in the last step, I tried this sudo apt install --no-install-recommends yarn and it worked. That was after doing sudo apt update
  • Marty McGee
    Marty McGee almost 2 years
    This answer has the most relevant and easy-to-use code, for copying + pasting. Thx.
  • beep_check
    beep_check over 1 year
    this answer is most relevant for debian-based linux users who were "guided" by the terminal to install cmdtest instead of yarn.
  • Rone Clay Brasil over 1 year
    the command sudo apt update && sudo apt install yarn also remove cmdtest
  • Admin
    Admin over 1 year
    This answer has the correct set of commands. This worked for me .