package cache
Download packages into the local cache so installs can run offline. This is like the first part of elm install where it
downloads a package to ELM_HOME, but it never adds the package to elm.json.
wrap package cache elm/html
wrap package cache elm/html@1.0.0 elm/json
wrap package cache missing
wrap package cache --from-file ./pkg elm/html
wrap package cache --from-url URL elm/html
This is an advanced command. Most of the time it is not necessary, as most commands have the same effect.
This is useful for CI and some development scenarios, where you need to populate the package cache for multiple builds.
Use cases include pre-warming CI caches, preparing offline builds, or repairing broken cache entries.
elm will automatically download packages into cache as it resolves them. It does so step-wise, in a lazy fashion:
every time it needs to check a package's version info or dependencies, it might download the package metadata and
then the full package later. This is completely OK and works well. Sometimes, however, it makes sense to download all
dependencies in one go; wrap package cache can do that.
Advanced use
Sometimes package cache can get stale or contain old broken packages, for example if the package author changed the
username on github, if a package was deleted, or if you're testing a CI cache setup. Running these subcommands may help
fix some issues in current ELM_HOME.
wrap package cache full-scan
wrap package cache check elm/html --fix-broken
wrap package cache --purge-broken
In a few situations, the package author rewrites the history of the package repository on GitHub and that invalidates
a package's SHA1 commit hash stored in the package registry manifest, preventing elm install from installing the package.
Using the --ignore-hash flag allows installing the package into the cache, after which elm install will work again.
For the most part, wrap package cache behaves like the first part of wrap package install, and so it shares its options. Installing
into cache from a file or URL works exactly the same as with package install using the --from-file and --from-url flags.
Helper options
-v, --verbose — Verbose output
-q, --quiet — Show only summary