The Yarn error "There are no scenarios; must have at least one" occurs when
you use the
yarn command from the
To solve the error, uninstall
cmdtest and add the yarn repository.
cmdtest command is used to test non-interactive Unix command line tools.
You don't need to have the command installed, so you can uninstall it because it
Open your terminal and run the following commands to uninstall
# uninstall cmdtest sudo apt remove cmdtest # uninstall yarn sudo apt remove yarn # make sure curl is installed sudo apt install curl # add yarn repository 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 # install yarn sudo apt update sudo apt install yarn
Make sure to add the yarn repository before you run the
sudo apt install yarn
sudo apt install yarncommand will install
If the Debian-specific installation command fails, try to install yarn using
npm install --global yarn
If that didn't work either, try running the following commands.
sudo apt remove cmdtest sudo apt install npm sudo npm install --global yarn
I've also written guides on:
After you run the commands, try to rerun your
yarn # or yarn install
You can also run the
yarn install <YOUR_PACKAGE> if you need to install a
specific package, e.g.
yarn add axios.
yarn add <YOUR_PACKAGE>
If you need to install a package as a development dependency, add the
yarn add jest --dev.
yarn add <YOUR_PACKAGE> --dev
Make sure your terminal is opened in your project's root directory (where your
package.json file is) before running the
yarn install commands.
yarn --version command runs successfully, then you've installed
If you get a version number back, then the issue is resolved.
You can learn more about the related topics by checking out the following tutorials: