简体   繁体   中英

Forcing package update with Mix

When I use the following command

mix deps.update --all

mix will use locally cached packages if the version of a package has not been changed in the mix.ex file. So the question is, how can I force mix not to use the cached version and download it from the server instead? For example, if there were changes in the last version of some package and I want to pick those up, even if the version has not been bumped.

First of a released Hex package can only be changed for up to 1 hour after it is initially created, after that it becomes immutable and wont ever change. In the future when Hex adds tooling for testing packages before release you will never be able to change a package that has been published.

Hex does a conditional GET request to fetch a package if it's already cached. If the package didn't change we use the cache, if it did change we fetch it again. If you are unable to reach the Hex CDN it will automatically use the cached package if it's available.

Additionally any time you get or update packages Hex will download a registry of all released packages which includes a checksum that we use to verify against the package tarball so you will never be able to use an outdated packages.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM