Skip to content

yarn misuses cache on git dependencies #4722

@SEAPUNK

Description

@SEAPUNK

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

What is the current behavior?
misuses cache to install the git dependency at the wrong commit, seems to happen particularly when specifying git branch

If the current behavior is a bug, please provide the steps to reproduce.
sample repo: https://github.com/SEAPUNK/yarn-test-thing

  1. yarn add SEAPUNK/yarn-test-thing
  2. edit package.json's dependency from SEAPUNK/yarn-test-thing to SEAPUNK/yarn-test-thing#branch
  3. edit the yarn.lock file to change the single dependency from what it is to
yarn-test-thing@seapunk/yarn-test-thing#branch:
  version "0.0.1-something"
  resolved "https://codeload.github.com/seapunk/yarn-test-thing/tar.gz/3ea9fe7984b9005f3cc62b14ee4018013ae0db0f"

i.e. what it will be when you run yarn upgrade

  1. yarn install
  2. inspect node_modules/yarn-test-thing, and see that the files BRANCH_ONE and BRANCH_TWO are not there

What is the expected behavior?
installs the right version at commit 3ea9fe7984b9005f3cc62b14ee4018013ae0db0f

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

node.js 8.7.0
yarn 1.2.1
macos high sierra


this is particularly annoying when you have committed a commit to the git dependency branch, ran yarn upgrade, check in the new yarn lockfile to the repo you're working on, only for yarn to not install that "resolved" version in the lockfile when someone else checks the code out and runs yarn install

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions