Yarn ERROR: There are no scenarios; must have at least one
JavascriptUbuntuDebianYarnpkgDebian BasedJavascript 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 :
sudo apt remove cmdtest
sudo apt autoremove
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
-
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
-
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
-
To download package information from all configured sources run following:
sudo apt update && sudo apt install yarn
-
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