Yarn: Integrity checked failed error

Created on 14 Sep 2019  Â·  20Comments  Â·  Source: yarnpkg/yarn

When I try to install one of my packages from the Github Package Manager I get the error bellow:

Integrity checked failed for "@tenjojeremy/eslint-config" (none of the specified algorithms are supported)

error

Most helpful comment

We got it working by:

  • Removing the yarn lock from the dependency ( in this case eslint-config )
  • Adding --update-checksums option to yarn install.

Along with the following npmrc.

always-auth=true
registry=https://npm.pkg.github.com/${org}
_authToken=${NPM_TOKEN_GITHUB}
//npm.pkg.github.com:_authToken=${NPM_TOKEN_GITHUB}

All 20 comments

I have the same problem with version 1.17.3 in Mac OS

me too :sob:

Same 😭

Although I like Yarn, but this time use NPM is success...

I have the same problem installing a package from the Github Package Registry, installing it with npm works.

Looking at the json response I get from https://npm.pkg.github.com/ when fetching the package metadata (under the path /versions/*/dist), there is no integrity property and the shasum property is an empty string. If I get a package from the official npm registry, they are both present. Maybe the problem is with the Github Package Registry? Does yarn require integrity to be present?

I asked Github support and this was their reply

Currently the only documented support we have for installing npm packages is using the npm client.
I've tried this myself, and encountered the same error that you are seeing. I do understand that Yarn is hugely popular for managing JavaScript and NodeJs projects and have therefore flagged this with engineering to look into.
I don't currently have an ETA on this, however we would love to align support with all the popular development tools over time.
I'll keep you posted on updates, and you can also checkout https://github.blog

We got it working by:

  • Removing the yarn lock from the dependency ( in this case eslint-config )
  • Adding --update-checksums option to yarn install.

Along with the following npmrc.

always-auth=true
registry=https://npm.pkg.github.com/${org}
_authToken=${NPM_TOKEN_GITHUB}
//npm.pkg.github.com:_authToken=${NPM_TOKEN_GITHUB}

The solution @ganmor presented worked great. Don't worry about a .yarnrc, just create a local .npmrc and things will work great.

If you want to verify what is happening just do an yarn add @org/package --verbose and look to see if you're getting a 401 unauthorized error. If so then this solution should work for you.

Note that there appears to be a tangentially related issue of authorization (sometimes?) being requested for public packages in the GitHub package registry producing similar symptoms (i.e. 401 errors despite the fact that authorization should not be required).

Update: Apparently GitHub package registry does not currently allow unauthenticated access to private or public packages but this may be added in the future.

I still see this

verbose 1.669 Request "https://npm.pkg.github.com/@org%2fmy-package" finished with status code 200.
verbose 2.596 Error: No algorithms available for ""
    at Integrity.pickAlgorithm (/usr/local/Cellar/yarn/1.19.1/libexec/lib/cli.js:32619:13)
    at Integrity.match (/usr/local/Cellar/yarn/1.19.1/libexec/lib/cli.js:32604:24)
    at /usr/local/Cellar/yarn/1.19.1/libexec/lib/cli.js:48145:58
    at Generator.next (<anonymous>)
    at step (/usr/local/Cellar/yarn/1.19.1/libexec/lib/cli.js:304:30)
    at /usr/local/Cellar/yarn/1.19.1/libexec/lib/cli.js:315:13

Still present in yarn v1.19.1

I'm on yarn 1.19.1 and the issue still remains for me as well.

The integrity checks fails with only some GitHub package registry packages. Some do have the integrity property and some don't. It's not consistent

I contacted GitHub support about these integrity issue and they said they were working to make GitHub registry compat with yarn. I assume they added support for integrity on their servers.

Package published before this date might be still failing with yarn but recent publish should work. I haven't retried since to confirm.

it works right now.
it's wired, rencently it is failing for me again

This is still failing for me. Anyone else?

@drewwyatt ✋

@drewwyatt Yes is it still failing.

Still failing

We got it working by:

  • Removing the yarn lock from the dependency ( in this case eslint-config )
  • Adding --update-checksums option to yarn install.

Along with the following npmrc.

always-auth=true
registry=https://npm.pkg.github.com/${org}
_authToken=${NPM_TOKEN_GITHUB}
//npm.pkg.github.com:_authToken=${NPM_TOKEN_GITHUB}

works for me as well, thanks @ganmor . I didn't remove the yarn.lock, just add the dependency into the package.json, then run yarn install --update-checksums.

I got it working by running all of these commands (fish):

set YARNCACHE (yarn cache dir); rm -rf $YARNCACHE; rm -rf node_modules;  yarn cache clean; yarn --update-checksums; yarn
Was this page helpful?
0 / 5 - 0 ratings