Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR: There are no scenarios; must have at least one. #2821

Closed
wangfaxi1985 opened this issue Mar 2, 2017 · 35 comments
Closed

ERROR: There are no scenarios; must have at least one. #2821

wangfaxi1985 opened this issue Mar 2, 2017 · 35 comments

Comments

@wangfaxi1985
Copy link

i want use "yarn " in my npm project
when run shell " yarn " in the shell,
it throw "ERROR: There are no scenarios; must have at least one. "

what problem?

yarn --version
0.27
node -v
v6.9.5
uname -a
Linux wfx-pc 4.4.0-3-deepin-amd64 #1 SMP Deepin 4.4.30-2 (2016-12-01) x86_64 GNU/Linux

@OmerHerera
Copy link

@wangfaxi1985, please check again your yarn version, the latest version is 0.21.3 and the tagged version is 0.22.0-0.
Also check that you run yarn command in the folder where your package.jsonis located
Thanks

@Daniel15
Copy link
Member

Daniel15 commented Mar 4, 2017

You've got the wrong yarn 😄 The Yarn you're executing comes from the cmdtest package: http://manpages.ubuntu.com/manpages/xenial/man1/yarn.1.html. Uninstalling cmdtest should fix this. Once you've uninstalled it, follow the instructions on https://yarnpkg.com/en/docs/install#linux-tab to add the Yarn repo:

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

@Daniel15 Daniel15 closed this as completed Mar 4, 2017
@becdetat
Copy link

becdetat commented Jun 5, 2017

cmdtest seems to be installed by default on Ubuntu 17.04 at least, so perhaps this should be added to the installation instructions...

For anyone that finds this, if you're getting an error on sudo apt-get install yarn run sudo apt remove cmdtest first.

@peter-kehl
Copy link

On Ubuntu (at least 17.04), after you sudo apt remove cmdtest, first follow https://yarnpkg.com/en/docs/install#linux-tab > Ubuntu. Only then sudo apt-get install yarn. If you don't follow https://yarnpkg.com/en/docs/install#linux-tab, then running sudo apt-get install yarn will install cmdtest again.

@istals
Copy link

istals commented Oct 31, 2017

On Ubuntu 17.10 I'm not able to install yarn - I removed cmdtest package, but sudo apt-get install yarn reinstall cmdtest.

@yuqingc
Copy link

yuqingc commented Nov 3, 2017

@istals I have the same problem as you do. The cmdtest is still installed even if I remove it firstly. How do I get yarn on Ubuntu 17.10?

@jdorleans
Copy link

jdorleans commented Nov 3, 2017

For Ubuntu 17.10, try the workaround:

sudo apt remove cmdtest
sudo apt install npm
sudo npm install -g yarn

@Daniel15
Copy link
Member

Daniel15 commented Nov 3, 2017

For Ubuntu 17.10, you need to add the Yarn repo first.

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 remove cmdtest
sudo apt install yarn

Make sure you remove cmdtest if you have it installed.

Prefer this to installing via npm.

@jdorleans - you don't have to install npm if you're using Yarn :)

@yuqingc
Copy link

yuqingc commented Nov 3, 2017

@jdorleans Thanks for your comment. I have successfully installed yarn by using npm install -g yarn.

@sheerun
Copy link
Contributor

sheerun commented Nov 27, 2017

Ubuntu: let's name binary of node package nodejs, but also let cmdtest binary be yarn

@cserpell
Copy link

This would be much easier if instead of installing it as root, it was installed in user space.

@Daniel15
Copy link
Member

Daniel15 commented Nov 30, 2017

@cserpell You can do that if you like. There's an install script you can use, or you could just download the Yarn tarball and extract it wherever you want. Details are on the site. Regardless, you're still going to have the issue of having multiple different multiple yarn binaries if you have cmdtest installed.

@sheerun To be fair, cmdtest used the yarn command first, before Yarn even existed.

@cserpell
Copy link

@Daniel15 That's what I did, specially because I cannot install programs where I am working. The trick is just overriding any installed binary with my own bin directory.

@egonyuri
Copy link

egonyuri commented Mar 22, 2018

I was having the same problem on Ubuntu 18.04 however I was able to fix using the following commands:

sudo apt remove cmdtest
sudo apt remove yarn
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

@Nazarah
Copy link

Nazarah commented Apr 12, 2018

@Daniel15 I followed your instructions in previous comment and tried to reinstall yarn again.

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

after checking the version, i found the version to be 1.5.1
Is it ok? Or I did something wrong.
Also would it create any problem if I uninstall cmdtest and all its dependencies?

@Daniel15
Copy link
Member

Daniel15 commented Apr 12, 2018

@Nazarah - That's correct, 1.5.1 is the latest stable version. If you want to get 1.6.0, you need to add the RC repo instead (replace "stable" with "rc" in /etc/apt/sources.list.d/yarn.list)

@Nazarah
Copy link

Nazarah commented Apr 12, 2018

@Daniel15
unintalling cmdtest and dependency and installing yarn.txt

The 1st text file shows commad results from uninstalling cmdtest and all its dependencies till using your suggested commands to install yarn

installing yarn fresh.txt

this files shows when I tried to run yarn from home

@Daniel15
Copy link
Member

I edited my comment because I realised that 1.5.1 is the latest version of Yarn :)

@Nazarah
Copy link

Nazarah commented Apr 12, 2018

Thanks for your feedback. :D

@Nazarah
Copy link

Nazarah commented Apr 12, 2018

@OmerHerera

Also check that you run yarn command in the folder where your package.jsonis located

Do you mean package.json for mastarm?

@florianeBhz
Copy link

@becdetat I have Ubuntu 17.04 installed but when I type yarn --version after installing yarn as recommended, i got this as message « yarn » is not installed yet.You can install by typing : sudo apt install cmdtest. Then I run sudo apt install cmdtest but it failled.

@Daniel15
Copy link
Member

@florianeBhz You need to add the Yarn repo first:

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

Then you can sudo apt-get update && sudo apt-get install yarn

More details on the Yarn site: https://yarnpkg.com/en/docs/install#debian-stable

@benjaoming
Copy link

For your Debian package, consider either conflicting with cmdtest in the debian/control; add a diversion in case the cmdtest executable already exists; use the update-alternatives pattern described here: https://wiki.debian.org/DebianAlternatives

JREAM added a commit to JREAM/config-ubuntu that referenced this issue May 16, 2018
@Daniel15
Copy link
Member

; use the update-alternatives pattern described here: wiki.debian.org/DebianAlternatives

Alternatives are for when you have multiple different apps that do the same thing. It's not for dealing with naming conflicts.

Having said that, adding a conflict with cmdtest seems reasonable. We can do that!

Daniel15 added a commit that referenced this issue May 28, 2018
The `cmdtest` package also installs a `yarn` command, and people often get confused by this (see #2821). If we specify that the Yarn package conflicts with the cmdtest package, installing Yarn will automatically uninstall cmdtest.
arcanis pushed a commit that referenced this issue May 28, 2018
The `cmdtest` package also installs a `yarn` command, and people often get confused by this (see #2821). If we specify that the Yarn package conflicts with the cmdtest package, installing Yarn will automatically uninstall cmdtest.
yvanzo added a commit to yvanzo/musicbrainz-docker that referenced this issue Jul 3, 2018
since both packages conflict,
see yarnpkg/yarn#2821

Note: Since Ubuntu 17.04, cmdtest is installed by default.
yvanzo added a commit to yvanzo/musicbrainz-docker that referenced this issue Jul 4, 2018
- Update yarnpkg apt repository only.

- Remove cmdtest if already installed as it conflicts with yarn,
  see yarnpkg/yarn#2821

  (Since Ubuntu 17.04, cmdtest is installed by default.)
yvanzo added a commit to yvanzo/musicbrainz-docker that referenced this issue Jul 4, 2018
- Update yarnpkg apt repository only.

- Remove cmdtest if already installed as it conflicts with yarn,
  see yarnpkg/yarn#2821

  (Since Ubuntu 17.04, cmdtest is installed by default.)
jsturgis pushed a commit to metabrainz/musicbrainz-docker that referenced this issue Jul 6, 2018
- Update yarnpkg apt repository only.

- Remove cmdtest if already installed as it conflicts with yarn,
  see yarnpkg/yarn#2821

  (Since Ubuntu 17.04, cmdtest is installed by default.)
@davux
Copy link

davux commented Sep 30, 2018

As a side comment: Ubuntu devs seemed to consider that when the user types apt-get install foo, if foo doesn't exist but there's a command with that name provided by package bar, then it's a good idea to almost silently install package bar instead.

$ sudo apt-get install yarn
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'cmdtest' instead of 'yarn'
[...]
$ dpkg -S bin/yarn
cmdtest: /usr/bin/yarn

I personally think it's one of those cases when people think implementing a less strict behaviour will make people's life easier but really just complicates things because it introduces randomness (for example this issue).

@shawnolson-fp
Copy link

Just use nvm to use npm to install yarn ...

sudo apt remove cmdtest
sudo apt remove yarn
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
nvm install node -lts
npm install -g yarn
yarn --version
1.12.3

You're welcome 🌮

@shawnolson-fp
Copy link

@shawnolson-fp - people should not trust a random script to install NVM. Isn't there an official method that you can quote instead of spreading an insecure installation pattern? Thanks!

https://github.com/creationix/nvm is the official project on Github. It's literally who created it. I don't know of a safer way to do it. The alternative would be using PPA which would point to nodesource.com ... only two ways I know of.

@Daniel15
Copy link
Member

Daniel15 commented Nov 13, 2018 via email

@shawnolson-fp
Copy link

@shawnolson-fp - that's not going to solve the problem listed in this issue. The issue is that a different app that provides a "yarn" command is installed. The only proper way of fixing that is by either uninstalling the other app or removing it from your $PATH. You can change the order of your $PATH instead, but having two apps that provide the same command can be pretty confusing anyways. Sent from my phone.

On Tue, Nov 13, 2018, 1:24 PM Benjamin Bach @.*** wrote: @shawnolson-fp https://github.com/shawnolson-fp - people should not trust a random script to install NVM. Isn't there an official method that you can quote instead of spreading an insecure installation pattern? Thanks! — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#2821 (comment)>, or mute the thread https://github.com/notifications/unsubscribe-auth/AAFnHe9xSSKcMf0WCOzezhob80rXrzeTks5uuzimgaJpZM4MQv_p .

I understand the issue but like you said, the way around it is too much trouble for most people who just want yarn to work. Why on earth Debian decided to choose cmdtest instead of yarn is what the problem is. I am simply providing an alternative way to install yarn and npm in the same $PATH as nvm - A pretty slick package if you ask me ...

And until the issue is fixed, very few people will want to mess around with environment variables to solve something that seems so simple.

@benjaoming
Copy link

@shawnolson-fp haha, yes I noticed that curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash was actually the official installation instruction and deleted my comment. But I am shocked. SHOCKED!

Also, Just use nvm to use npm to install yarn ...... cruel cruel world. I hope everyone will think twice before doing this to get left-pad or whatever.

Btw. most Debian issues are solved revolving this. Except having an official package seems a bit out of reach still.

I would definitely not go with your pattern, it's overcomplicated.

Why on earth Debian decided to choose cmdtest instead of yarn is what the problem is.

Point the finger back at yarn. They were warned that this package name was taken before their public launch and have had inputs from Debian packaging people trying to solve this still. There is a current effort to create a package underway such that an official release can be in Debian and downstream dists such as Ubuntu.

@benjaoming
Copy link

@Daniel15 looking over this issue, it seems safe enough to close+freeze with a final note about reading the documentation? It seems keeping it open spins off undesirable workarounds?

References for ongoing Debian work:

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=843021
https://salsa.debian.org/js-team/node-yarnpkg

@shawnolson-fp
Copy link

@benjaoming lol - that is something I didn't know, man what a mess!

I feel for both sides, because IMO Debian and Yarn are both the best at what they are, so I'm torn 😢
You'd think maybe a simple prompt at install: which yarn would you like to install @facebook/yarn or cmdtest/yarn?

At this point, most people will probably just say $# it and use npm. 😩

@arcanis
Copy link
Member

arcanis commented Nov 13, 2018

@facebook/yarn

Not related to the issue at hand, but Yarn is a community project, not a Facebook one - it would be @yarnpkg/yarn 🙂

@shawnolson-fp
Copy link

@arcanis lol it was just an example 😋... so literal in here, ha!

@Daniel15
Copy link
Member

looking over this issue, it seems safe enough to close+freeze with a final note about reading the documentation?

Good idea. I'm going to lock this as lots of unrelated (but valuable!) discussion is happening here. Feel free to create separate issues if there's anything left to discuss. In the meantime, please uninstall cmdtest if you want to use Yarn. The Yarn Debian package "conflicts" with cmdtest, so it should warn you about it.

@yarnpkg yarnpkg locked as resolved and limited conversation to collaborators Nov 13, 2018
abraaoz added a commit to abraaoz/php-fpm-swoole that referenced this issue Feb 26, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests