Skip to content

node_modules/.bin are overriden by wrong symlink binaries from not related packages #3983

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

Closed
Hotell opened this issue Jul 21, 2017 · 2 comments

Comments

@Hotell
Copy link

Hotell commented Jul 21, 2017

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

What is the current behavior?
when I install packages like for instance

then I run yarn tsc and something terrible happens :) , instead of tsc being 2.2.2 it is 2.4.2.

Why is that? well testcafe has typescript: ^2.2.2 as dependency ( so latest 2.x is installed under node_modules of testcafe, which is ok-ish ). What is huge issue although, is, that my project node_modules/.bin/tsc is overriden and the symlink is not pointing to my typescript devDependency, but instead it is pointing to testcafe's typescript.

With npm everything works as it should

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

mkdir issue-repro && cd $_ && yarn add -D [email protected] testcafe@latest && yarn tsc -- -v`

this will emit Version 2.4.2 instead of 2.2.2

This is a huge deal as projects relying on local deps are broken and will not pass CI

screen shot 2017-07-21 at 12 30 16 pm

Related:
TypeStrong/typedoc#556
DevExpress/testcafe#1632
#3975

What is the expected behavior?

not ovewriting symlinks in node_modules/.bin by non related package

Please mention your node.js, yarn and operating system version.
yarn: 0.27.5
os: both OSX/Windows 10

@Hotell Hotell changed the title node_modules/.bin are overiden by wrong symlink binaries from not related packages node_modules/.bin are overriden by wrong symlink binaries from not related packages Jul 21, 2017
@rally25rs
Copy link
Contributor

I think this was broken by #3545
and fixed by #3877

@Hotell
Copy link
Author

Hotell commented Jul 21, 2017

Cool when can we expect new release ? cheers

StephenRadachy added a commit to StephenRadachy/graphql-liftoff that referenced this issue Oct 31, 2017
- Yarn was overwriting the node_modules/.bin for tsc with ../ts-structure-parser/node_modules/typescript/bin/tsc../ts-structure-parser/node_modules/typescript/bin/tsc
  - Seems to be a bug in Yarn. See: yarnpkg/yarn#3983
  - Solution: updated tsc in scripts to directly use node_modules/typescript/bin/tsc
- Jest was failing because the ERRNO response was different for Ubuntu than Mac OS
  - Solution: updated test to use regex to verify the error code.
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