How to Fix "Integrity check failed ..." Yarn Error

What to do when running into integrity check errors with Yarn.

Seeing an error like this?

error https://registry.yarnpkg.com/...:
Integrity check failed for "..."
(computed integrity doesn't match our records, got "sha512-... sha1-...")

Yarn suggests clearing the cache, which you can do with:

$ yarn cache clean

That didn't work for me because the integrity checksum was stored in the yarn.lock file. One option is to delete that file and regenerate it by running:

$ yarn install

That didn't work for me either, and it's not a great practice. In that case you're potentially updating all packages when really you just have a single issue with a single package.

Instead, I ran the following command:

$ yarn --update-checksums

This updated all the integrity checksums and then I was able to install the remainder of the packages and get the project working.


Let's Connect

Keep Reading

Round to the nearest 0.5 in Ruby

A cool and quick trick to round floats to the nearest 0.5 in Ruby.

Nov 01, 2014

Your Audience Doesn't Care About You, And That's Awesome

It can be nerve-wracking to perform in front of people. But your audience doesn't notice or care how nervous you are, so why worry about it?

Aug 21, 2015

My Leap of Faith

Oct 1, 2015: Day 1 of Month 1, The 15-Month Plan.

Feb 28, 2017