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

"yarn" command should look for both "node" and "nodejs" #1142

Closed
Daniel15 opened this issue Oct 17, 2016 · 1 comment
Closed

"yarn" command should look for both "node" and "nodejs" #1142

Daniel15 opened this issue Oct 17, 2016 · 1 comment

Comments

@Daniel15
Copy link
Member

Daniel15 commented Oct 17, 2016

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

What is the current behavior?
Yarn always executes node (due to the shebang of #!/usr/bin/env node), and always executes nodejs on Debian/Ubuntu (we sed the shebang when building the package: https://github.com/yarnpkg/yarn/blob/master/scripts/build-deb.sh#L74).

The tricky/unfortunate thing with Node.js on Debian is that /usr/bin/node conflicted with another package. See:
https://lists.debian.org/debian-devel-announce/2012/07/msg00002.html
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=614907

In the end, both packages that used the node binary name were renamed - Node.js became nodejs, and the other Node (some ham radio app) became ax25-node. This means that when installing Node.js via Debian package, the binary is called nodejs. However, for other installation methods (such as nvm), the binary is called node.

Installing both Yarn and Node.js via Debian package is generally the preferred method, and works fine. However, this naming does have several implications when mixing and matching different installation styles:

  • Yarn installed via npm will fail with Node.js installed via Debian package (it'll try to run node which doesn't exist)
  • Yarn installed via Debian package will fail with Node.js installed via nvm (it'll try to run nodejs which doesn't exist)

Often people work around this by symlinking /usr/bin/node to /usr/bin/nodejs or vice-versa, but that's hacky.

Instead, we should update bin/yarn to try both node and nodejs. For example, try to execute node yarn.js, and if that fails, try to execute nodejs yarn.js instead.

Also see https://github.com/yarnpkg/rfcs/issues/9

@vTNT
Copy link

vTNT commented Oct 17, 2016

+1

Daniel15 added a commit to Daniel15/yarn that referenced this issue Oct 18, 2016
Daniel15 added a commit to Daniel15/yarn that referenced this issue Oct 18, 2016
Daniel15 added a commit to Daniel15/yarn that referenced this issue Oct 18, 2016
Daniel15 added a commit to Daniel15/yarn that referenced this issue Oct 18, 2016
bestander pushed a commit that referenced this issue Oct 18, 2016
Daniel15 added a commit that referenced this issue Oct 19, 2016
Daniel15 added a commit that referenced this issue Oct 19, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants