Skip to content

yarn install overwrites linked modules with cached version #1214

@lukebennett

Description

@lukebennett

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

Bug

What is the current behavior?

Running yarn install for an app that has linked modules results in yarn copying its cached version of each module to the symlinked directory, overwriting the local copy in the process.

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

I struggled to reproduce this from scratch, it's possible that it's down to a specific combination of factors with my setup. This involves local copies of private/scoped npm modules yarn linked from an application, and referenced in package.json via file:../xxx. The version of the modules yarn has in its cache appears to be from when I first installed and ran it a few days ago (there have been numerous changes to the modules since), so it's possible the problem lies with its caching strategy as much as its installation strategy.

One observation I've made is that the problem occurs even when using yarn install --force to supposedly bypass the cache.

Happy to answer any questions and/or try anything to help pinpoint the problem.

What is the expected behavior?

yarn install should skip linked modules like npm intstall does. Performing the same steps above using npm install does not result in this problem.

Please mention your node.js, yarn and operating system version.

node v6.2.2
yarn v0.16.0
Mac OS X v10.10.5

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