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

JavascriptUbuntuDebianYarnpkgDebian Based

Javascript Problem Overview


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?

Javascript Solutions


Solution 1 - Javascript

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

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

The real name you should use when installing is yarnpkg

sudo apt install yarnpkg

That is the solution.

Solution 4 - Javascript

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

sudo npm install -g yarn

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

Solution 6 - Javascript

I began to receive this error after upgrade to nodejs. The steps to fix those bugs were :

  1. sudo apt remove cmdtest
  2. sudo apt autoremove
  3. sudo npm install -g yarn

Solution 7 - Javascript

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

To solve this problem you should install yarn from its official website https://yarnpkg.com/getting-started/install. I recommend to read more about yarn on above website

  1. To transfer data you can use from curl

    curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
    

    The output looks like this:

    OK
    
  2. To know either data was transferred or not , you can display that text/string by using echo command( it is linux built-in command)

    echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
    

    The output also looks like following:

    deb https://dl.yarnpkg.com/debian/ stable main
    
  3. To download package information from all configured sources run following:

    sudo apt update && sudo apt install yarn
    
  4. After this stage finished check yarn version by

    yarn --version
    

    The output looks like this

    1.22.18
    

Or you can install yarn by npm

npm install -g yarn

Solution 8 - Javascript

it is name "yarnpkg" ,not "yarn"


#which yarn
/usr/bin/yarn

# which yarnpkg
/usr/bin/yarnpkg

#yarn --version
0.32+git

# yarnpkg --version
1.22.10


# cat /usr/bin/yarn

#!/usr/bin/python3
# Copyright 2013  Lars Wirzenius
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
# =*= License: GPL-3+ =*=


import cliapp
...




# cat /usr/bin/yarnpkg 


#!/usr/bin/env node

/* eslint-disable no-var */
/* eslint-disable flowtype/require-valid-file-annotation */
'use strict';

var ver = process.versions.node;
var majorVer = parseInt(ver.split('.')[0], 10);

if (majorVer < 4) {
  console.error('Node version ' + ver + ' is not supported, please use Node.js 4.0 or higher.');
  process.exit(1); // eslint-disable-line no-process-exit
} else {
  try {
    require(__dirname + '/../lib/v8-compile-cache.js');
  } catch (err) {
    // We don't have/need this on legacy builds and dev builds
  }

  // Just requiring this package will trigger a yarn run since the
  // `require.main === module` check inside `cli/index.js` will always
  // be truthy when built with webpack :(
  // `lib/cli` may be `lib/cli/index.js` or `lib/cli.js` depending on the build.
  var cli = require(__dirname + '/../lib/cli');
  if (!cli.autoRun) {
    cli.default().catch(function(error) {
      console.error(error.stack || error.message || error);
      process.exitCode = 1;
    });
  }
}


Solution 9 - Javascript

sudo apt install --no-install-recommends yarn

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionFrancesco BorziView Question on Stackoverflow
Solution 1 - JavascriptFrancesco BorziView Answer on Stackoverflow
Solution 2 - JavascriptPeorayView Answer on Stackoverflow
Solution 3 - JavascriptLaynier PiedraView Answer on Stackoverflow
Solution 4 - JavascriptFaizuddin MohammadView Answer on Stackoverflow
Solution 5 - JavascriptMuhammed ASLANView Answer on Stackoverflow
Solution 6 - JavascriptBruno VivaldoView Answer on Stackoverflow
Solution 7 - JavascriptAsadullo AkramovView Answer on Stackoverflow
Solution 8 - JavascriptqidiziView Answer on Stackoverflow
Solution 9 - JavascriptRuan NaweView Answer on Stackoverflow