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

Use of yarn-offline-mirror and the yarn cache leads to missing packages in offline mirror. #8361

Open
SirensOfTitan opened this issue Sep 28, 2020 · 2 comments

Comments

@SirensOfTitan
Copy link

Bug description

We check all of the tgz of our packages into source control, and run our CI in offline mode for generally reproduce-able builds. Occasionally, when we're dealing with package upgrades, we get into a state
where yarn doesn't put the package into yarn-offline-mirror directory when the package exists inside the local cache (at yarn cache dir).

Command

yarn install foo@6.0
# maybe we decide against it after playing with the upgrade, so we revert package.json
yarn install foo@5.0
# ... then later on: we install 6.0 again, it's a cache hit in `yarn cache dir`, so `yarn-offline-mirror` is not included in the git repo, causing CI to fail builds.
yarn install foo@6.0

What is the current behavior?
Currently, yarn is not populating the offline-mirror directory if it experiences a cache hit in the yarn cache dir system cache.

What is the expected behavior?
Yarn should always install the tgz of packages as specified in yarn.lock regardless of the contents of the system cache. It could perhaps just copy the package archive if it experiences a hit in yarn cache dir.

Steps to Reproduce
I haven't tested this, but it goes something like (also above):

yarn install foo@6.0
# maybe we decide against it after playing with the upgrade, so we revert package.json
yarn install foo@5.0
# ... then later on: we install 6.0 again, it's a cache hit in `yarn cache dir`, so `yarn-offline-mirror` is not included in the git repo, causing CI to fail builds.
yarn install foo@6.0

Environment

  • Node Version: 14.7.0
  • Yarn v1 Version: 1.22.5
  • OS and version: ArchLinux, -
@pedroteixeira
Copy link

is there really still an open issue if using yarn offline mirror?

@robgallen
Copy link

Ran into this issue recently. Yarn 1.22.19, Node 18.19.1, Windows 10
I ran yarn cache clear and then yarn install and a load of packages appeared in my offline mirror, which I use for CI/CD build on a build server that has no internet access.

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

3 participants