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 "/usr/bin/yarn: [[: not found" with 0.24.0 #3321

Closed
pichouk opened this issue May 4, 2017 · 5 comments
Closed

Error "/usr/bin/yarn: [[: not found" with 0.24.0 #3321

pichouk opened this issue May 4, 2017 · 5 comments

Comments

@pichouk
Copy link
Contributor

pichouk commented May 4, 2017

Using the latest yarn version 0.24.0

user@hostname:/tmp$ yarn --version
/usr/bin/yarn: 15: /usr/bin/yarn: [[: not found
0.24.0

Do you want to request a feature or report a bug?
Reporting a bug

What is the current behavior?
When I use the yarn command, it works but I always get this :

/usr/bin/yarn: 15: /usr/bin/yarn: [[: not found

Then my command is executed normally.

If the current behavior is a bug, please provide the steps to reproduce.

  • Using Debian (testing) with 4.9.0-2 kernel.
  • Install the deb package for Yarn 0.24.0. Not currently available on repository, find it here
  • Use yarn command (eg. yarn --version)

What is the expected behavior?
It seems there is a problem with the Yarn "entrypoint" script. Did not investigate on it, I just report this before version 0.24.0 is pushed into APT repository.

I'm not sure, but the .deb package seems really light (580KB) comparing to previous versions (1.95MB). Maybe it is not generated well ?

@bestander
Copy link
Member

Related to #3260 and #3245.
@Daniel15, do you know what trickery is this?

@Daniel15
Copy link
Member

Daniel15 commented May 4, 2017

Hmm this is very weird. I thought [[ is a standard shell thing.

I think the issue is that we use /bin/sh instead of /bin/bash in the shebang (https://github.com/yarnpkg/yarn/blob/master/bin/yarn), and we're using stuff that is not portable across shells. It's likely your /bin/sh is another shell such as dash.

the .deb package seems really light (580KB) comparing to previous versions (1.95MB).

This is intentional due to #3030 :D
It's unrelated to this issue.

Daniel15 added a commit that referenced this issue May 4, 2017
@Daniel15
Copy link
Member

Daniel15 commented May 4, 2017

@bestander Simply changing the shebang in bin/yarn from #!/bin/sh to #!/bin/bash is probably enough to resolve this.

@pichouk
Copy link
Contributor Author

pichouk commented May 5, 2017

On my configuration, I confirmed that it solved the issue.
Is that possible to add this on 0.24 version ?

bestander pushed a commit that referenced this issue May 11, 2017
#3260 PR broke the `bin/yarn` shell script (see issue #3321)
#3338 tried to fix it in a improper way

This way should work.
@pichouk
Copy link
Contributor Author

pichouk commented May 12, 2017

Should be fixed by merged PR #3362

@pichouk pichouk closed this as completed May 12, 2017
Daniel15 pushed a commit that referenced this issue May 12, 2017
#3260 PR broke the `bin/yarn` shell script (see issue #3321)
#3338 tried to fix it in a improper way

This way should work.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants