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?
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?
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
sudo apt install --no-install-recommends yarn
and it worked. That was after doing sudo apt update
–
Wray 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
The real name you should use when installing is yarnpkg
sudo apt install yarnpkg
That is the solution.
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
sudo npm install -g yarn
then open a new terminal window and type yarn --version
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
npm install -g yarn
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
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
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;
});
}
}
It is recommended to use NPM
to install yarn.
To achieve this, do:
npm install --global yarn
yarn --version
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
sudo apt install --no-install-recommends yarn
© 2022 - 2024 — McMap. All rights reserved.
sudo apt remove yarn
didn't do anything, I had to usesudo apt remove cmdtest
– Ostyak