Skip to content

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

@Hotell

Description

@Hotell

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions