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

12

141

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?

Puleo answered 25/11, 2018 at 19:27 Comment(0)
P
346

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
Puleo answered 25/11, 2018 at 19:27 Comment(3)
I found sudo apt remove yarn didn't do anything, I had to use sudo apt remove cmdtestOstyak
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 updateWray
the command sudo apt update && sudo apt install yarn also remove cmdtestWileen
M
114

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
Mythicize answered 1/2, 2020 at 11:22 Comment(6)
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.Darya
This answer has the most relevant and easy-to-use code, for copying + pasting. Thx.Scoggins
this answer is most relevant for debian-based linux users who were "guided" by the terminal to install cmdtest instead of yarn.Fulani
This answer has the correct set of commands. This worked for me .Bach
You are an angel!Chaconne
removing cmdtest is the keyEcclesiastes
M
28

The real name you should use when installing is yarnpkg

sudo apt install yarnpkg

That is the solution.

Melosa answered 16/10, 2020 at 15:34 Comment(0)
F
16

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
Finecut answered 3/12, 2020 at 12:9 Comment(0)
P
15
sudo npm install -g yarn

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

Pandemic answered 9/1, 2021 at 22:4 Comment(0)
D
9

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
Decrepitate answered 31/3, 2022 at 6:38 Comment(0)
D
5

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
Doodle answered 7/12, 2020 at 18:23 Comment(0)
P
2

Just an update

curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/yarnpkg.gpg
sudo apt update && sudo apt install yarn
yarn
Perigee answered 18/10, 2022 at 16:58 Comment(1)
Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.Craving
R
1

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;
    });
  }
}


Rozella answered 14/3, 2022 at 7:1 Comment(0)
K
0

It is recommended to use NPM to install yarn. To achieve this, do:

  • npm install --global yarn
  • yarn --version

learn more

Kunzite answered 17/8, 2022 at 15:7 Comment(0)
S
0

step 1 -> sudo apt remove cmdtest

step 2 -> Download yarnpkg key curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - output - OK

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

step 4 -> Update and install yarn sudo apt update && sudo apt install yarn

step 5 -> Check yarn version yarn --version output - 1.22.19

Skirret answered 1/9, 2023 at 10:56 Comment(0)
M
-2

sudo apt install --no-install-recommends yarn

Margoriemargot answered 2/5, 2019 at 16:59 Comment(1)
When posting an answer, please explain what was wrong and how the answer fixes the issue.Asteriated

© 2022 - 2024 — McMap. All rights reserved.