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 installs old versions in .bin #3801

Closed
domoritz opened this issue Jul 2, 2017 · 8 comments
Closed

Yarn installs old versions in .bin #3801

domoritz opened this issue Jul 2, 2017 · 8 comments

Comments

@domoritz
Copy link

domoritz commented Jul 2, 2017

Reproduce with

git clone [email protected]:vega/vega-lite.git
cd vega-lite
rm yarn.lock
yarn
node_modules/.bin/uglifyjs --version

Prints uglify-js 2.8.29 but should print version 3.

@domoritz domoritz changed the title Yarn installs old version Yarn installs old versions in .bin Jul 2, 2017
domoritz added a commit to vega/vega-lite that referenced this issue Jul 3, 2017
domoritz added a commit to vega/vega-lite that referenced this issue Jul 3, 2017
domoritz added a commit to vega/vega-lite that referenced this issue Jul 3, 2017
@bestander
Copy link
Member

Can repro this with latest Yarn.
Worked in 0.24

@bestander
Copy link
Member

uglifyjs -> ../handlebars/node_modules/uglify-js/bin/uglifyjs

@bestander
Copy link
Member

package-linker.js determineTopLevelBinLinks has incorrect logic inside.
It needs to go through top level dependencies first and then through the flat tree.

@BYK BYK added the triaged label Jul 5, 2017
@msakrejda
Copy link

As another data point, 0.24.6 works correctly for me, and 0.25.4 breaks (it means our yarn script uses the wrong eslint version and breaks our linting).

@pselden
Copy link

pselden commented Jul 7, 2017

Also, if there is one without a bin and one with, it won't even put anything in .bin.

Example:

{
  "name": "test-yarn",
  "version": "1.0.0",
  "main": "index.js",
  "license": "MIT",
  "devDependencies": {
    "sane": "^2.0.0",
    "watch": "^1.0.2"
  }
}

sane depends on watch 0.10.0, which has no .bin, but watch 1.0 does. No watch command is added to node_modules/.bin

@gkalpak
Copy link

gkalpak commented Jul 7, 2017

Just got bitten by this too. It seems that was broken in 0.25.4 (0.25.3 works fine): v0.25.3...v0.25.4

@timfish
Copy link

timfish commented Jul 9, 2017

Our CI builds started failing only on linux because of this as our provider updated yarn to v0.27.5.
This repo reproduces the issue: https://github.com/timfish/yarn-test

Running yarn build:html used to work and now it fails as the version of html-minifier in .bin is an older version which is a dependency of aurelia-bunder.

@kaylie-alexa
Copy link
Member

I have a working PR to fix this issue here #3877

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

8 participants