yarn
yarn copied to clipboard
Use of `yarn-offline-mirror` and the yarn cache leads to missing packages in offline mirror.
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 [email protected]
# maybe we decide against it after playing with the upgrade, so we revert package.json
yarn install [email protected]
# ... 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 [email protected]
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 [email protected]
# maybe we decide against it after playing with the upgrade, so we revert package.json
yarn install [email protected]
# ... 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 [email protected]
Environment
- Node Version:
14.7.0
- Yarn v1 Version:
1.22.5
- OS and version: ArchLinux, -