yarnpkg / yarn

The 1.x line is frozen - features and bugfixes now happen on https://github.com/yarnpkg/berry
https://classic.yarnpkg.com
Other
41.44k stars 2.73k forks source link

Yarn install fails with "Incorrect integrity when fetching from the cache" #7589

Closed danechitoaie closed 5 years ago

danechitoaie commented 5 years ago

Since upgrading to Yarn v1.19.0 we started getting the following error on yarn install phase:

Incorrect integrity when fetching from the cache

We have lots of repos, each with their own package.json and respective yarn.lock file and I've noticed (checking the yarn cache folder) that we have three different versions of browserslist being used:

/Users/daniels/Library/Caches/Yarn/v5
┗ $ ls | grep browserslist
npm-browserslist-4.6.3-0530cbc6ab0c1f3fc8c819c72377ba55cf647f05
npm-browserslist-4.6.6-6e4bf467cde520bc9dbdf3747dafa03531cec453
npm-browserslist-4.7.0-9ee89225ffc07db03409f2fee524dc8227458a17

For some reason npm-browserslist-4.6.6-6e4bf467cde520bc9dbdf3747dafa03531cec453 does not have the integrity field in its .yarn-metadata.json file which I guess causes yarn to fail when checking the cache integrity.

Here's also the .yarn-metadata.json contents:

{
  "manifest": {
    "name": "browserslist",
    "version": "4.6.6",
    "description": "Share target browsers between different front-end tools, like Autoprefixer, Stylelint and babel-env-preset",
    "keywords": [
      "caniuse",
      "browsers",
      "target"
    ],
    "author": {
      "name": "Andrey Sitnik",
      "email": "andrey@sitnik.ru"
    },
    "license": "MIT",
    "repository": {
      "type": "git",
      "url": "https://github.com/browserslist/browserslist.git"
    },
    "dependencies": {
      "caniuse-lite": "^1.0.30000984",
      "electron-to-chromium": "^1.3.191",
      "node-releases": "^1.1.25"
    },
    "bin": {
      "browserslist": "./cli.js"
    },
    "browser": {
      "./node.js": "./browser.js",
      "path": false
    },
    "_registry": "npm",
    "_loc": "/Users/daniels/Library/Caches/Yarn/v5/npm-browserslist-4.6.6-6e4bf467cde520bc9dbdf3747dafa03531cec453/node_modules/browserslist/package.json",
    "readmeFilename": "README.md",
    "readme": "# Browserslist [![Cult Of Martians][cult-img]][cult]\n\n<img width=\"120\" height=\"120\" alt=\"Browserslist logo by Anton Lovchikov\"\n     src=\"https://browserslist.github.io/browserslist/logo.svg\" align=\"right\">\n\nThe config to share target browsers and Node.js versions between different\nfront-end tools. It is used in:\n\n* [Autoprefixer]\n* [Babel]\n* [postcss-preset-env]\n* [eslint-plugin-compat]\n* [stylelint-no-unsupported-browser-features]\n* [postcss-normalize]\n* [obsolete-webpack-plugin]\n\nAll tools will find target browsers automatically,\nwhen you add the following to `package.json`:\n\n```js\n  \"browserslist\": [\n    \"last 1 version\",\n    \"> 1%\",\n    \"maintained node versions\",\n    \"not dead\"\n  ]\n```\n\nOr in `.browserslistrc` config:\n\n```yaml\n# Browsers that we support\n\nlast 1 version\n> 1%\nmaintained node versions\nnot dead\n```\n\nDevelopers set versions list in queries like `last 2 version`\nto be free from updating versions manually.\nBrowserslist will use [Can I Use] data for this queries.\n\nBrowserslist will take queries from tool option,\n`browserslist` config, `.browserslistrc` config,\n`browserslist` section in `package.json` or environment variables.\n\nYou can test Browserslist queries in [online demo].\n[Browserslist Example] shows how every tool uses Browserslist.\n\n[cult-img]: https://cultofmartians.com/assets/badges/badge.svg\n[cult]: https://cultofmartians.com/done.html\n\n<a href=\"https://evilmartians.com/?utm_source=browserslist\">\n  <img src=\"https://evilmartians.com/badges/sponsored-by-evil-martians.svg\"\n       alt=\"Sponsored by Evil Martians\" width=\"236\" height=\"54\">\n</a>\n\n[stylelint-no-unsupported-browser-features]: https://github.com/ismay/stylelint-no-unsupported-browser-features\n[eslint-plugin-compat]:                      https://github.com/amilajack/eslint-plugin-compat\n[Browserslist Example]:                      https://github.com/browserslist/browserslist-example\n[postcss-preset-env]:                        https://github.com/jonathantneal/postcss-preset-env\n[postcss-normalize]:                         https://github.com/jonathantneal/postcss-normalize\n[Autoprefixer]:                              https://github.com/postcss/autoprefixer\n[online demo]:                               https://browserl.ist/\n[Can I Use]:                                 https://caniuse.com/\n[Babel]:                                     https://github.com/babel/babel/tree/master/packages/babel-preset-env\n[obsolete-webpack-plugin]:                   https://github.com/ElemeFE/obsolete-webpack-plugin\n\n## Table of Contents\n\n1. [Tools](#tools)\n2. [Best Practices](#best-practices)\n3. [Queries](#queries)\n4. [Config File](#config-file)\n5. [Configuring for Different Environments](#configuring-for-different-environments)\n6. [Custom Usage Data](#custom-usage-data)\n7. [JS API](#js-api)\n8. [Environment Variables](#environment-variables)\n9. [Cache](#cache)\n\n## Tools\n\n* [`browserslist-ga`] downloads your website browsers statistics\n  to use it in `> 0.5% in my stats` query.\n* [`browserslist-useragent-regexp`] compiles Browserslist query to a RegExp\n  to test browser useragent.\n* [`browserslist-useragent-ruby`] is a Ruby library to checks browser\n  by user agent string to match Browserslist.\n* [`browserslist-browserstack`] runs BrowserStack tests for all browsers\n  in Browserslist config.\n* [`caniuse-api`] returns browsers which support some specific feature.\n* Run `npx browserslist` in your project directory to see project’s\n  target browsers. This CLI tool is built-in and available in any project\n  with Autoprefixer.\n\n[`browserslist-useragent-ruby`]:   https://github.com/browserslist/browserslist-useragent-ruby\n[`browserslist-useragent`]:        https://github.com/pastelsky/browserslist-useragent\n[`browserslist-useragent-regexp`]: https://github.com/browserslist/browserslist-useragent-regexp\n[`browserslist-ga`]:               https://github.com/browserslist/browserslist-ga\n[`caniuse-api`]:                   https://github.com/Nyalab/caniuse-api\n[`browserslist-browserstack`]:     https://github.com/xeroxinteractive/browserslist-browserstack\n\n\n## Best Practices\n\n* Select browsers directly (`last 2 Chrome versions`) only if you are making\n  a web app for a kiosk with one browser. There are a lot of browsers\n  on the market. If you are making general web app you should respect\n  browsers diversity.\n* There is a `defaults` query, which gives a reasonable configuration\n  for most users:\n\n  ```json\n    \"browserslist\": [\n      \"defaults\"\n    ]\n  ```\n\n* If you want to change the default set of browsers we recommend to combine\n  `last 1 version`, `not dead` with `> 0.2%` (or `> 1% in US`,\n  `> 1% in my stats`). `last n versions` adds too many dead browsers\n  and does not add popular old versions. Choosing a percentage above `0.2%`\n  will in the long run make popular browsers even more popular. We might run\n  into a monopoly and stagnation situation, as we had with Internet Explorer 6.\n  Please use this setting with caution.\n* Don’t remove browsers just because you don’t know them. Opera Mini has\n  100 million users in Africa and it is more popular in the global market\n  than Microsoft Edge. Chinese QQ Browsers has more market share than Firefox\n  and desktop Safari combined.\n\n\n## Queries\n\nBrowserslist will use browsers and Node.js versions query\nfrom one of this sources:\n\n1. `browserslist` key in `package.json` file in current or parent directories.\n   **We recommend this way.**\n2. `.browserslistrc` config file in current or parent directories.\n3. `browserslist` config file in current or parent directories.\n4. `BROWSERSLIST` environment variable.\n5. If the above methods did not produce a valid result\n   Browserslist will use defaults:\n   `> 0.5%, last 2 versions, Firefox ESR, not dead`.\n\n\n### Query Composition\n\nAn `or` combiner can use the keyword `or` as well as `,`.\n`last 1 version or > 1%` is equal to `last 1 version, > 1%`.\n\n`and` query combinations are also supported to perform an\nintersection of the previous query: `last 1 version and > 1%`.\n\nThere is 3 different ways to combine queries as depicted below. First you start\nwith a single query and then we combine the queries to get our final list.\n\nObviously you can *not* start with a `not` combiner, since there is no left-hand\nside query to combine it with.\n\n| Query combiner type | Illustration | Example |\n| ------------------- | :----------: | ------- |\n|`or`/`,` combiner <br> (union) | ![Union of queries](img/union.svg)  | `> .5% or last 2 versions` <br> `> .5%, last 2 versions` |\n| `and` combiner <br> (intersection) | ![intersection of queries](img/intersection.svg) | `> .5% and last 2 versions` |\n| `not` combiner <br> (relative complement) | ![Relative complement of queries](img/complement.svg) | `> .5% and not last 2 versions` <br> `> .5% or not last 2 versions` <br> `> .5%, not last 2 versions` |\n\n_A quick way to test your query is to do `npx browserslist '> 0.5%, not IE 11'`\nin your terminal._\n\n\n### Full List\n\nYou can specify the browser and Node.js versions by queries (case insensitive):\n\n* `> 5%`: browsers versions selected by global usage statistics.\n  `>=`, `<` and `<=` work too.\n* `> 5% in US`: uses USA usage statistics. It accepts [two-letter country code].\n* `> 5% in alt-AS`: uses Asia region usage statistics. List of all region codes\n  can be found at [`caniuse-lite/data/regions`].\n* `> 5% in my stats`: uses [custom usage data].\n* `cover 99.5%`: most popular browsers that provide coverage.\n* `cover 99.5% in US`: same as above, with [two-letter country code].\n* `cover 99.5% in my stats`: uses [custom usage data].\n* `maintained node versions`: all Node.js versions, which are [still maintained]\n  by Node.js Foundation.\n* `node 10` and `node 10.4`: selects latest Node.js `10.x.x`\n  or `10.4.x` release.\n* `current node`: Node.js version used by Browserslist right now.\n* `extends browserslist-config-mycompany`: take queries from\n  `browserslist-config-mycompany` npm package.\n* `ie 6-8`: selects an inclusive range of versions.\n* `Firefox > 20`: versions of Firefox newer than 20.\n  `>=`, `<` and `<=` work too. It also works with Node.js.\n* `iOS 7`: the iOS browser version 7 directly.\n* `Firefox ESR`: the latest [Firefox ESR] version.\n* `unreleased versions` or `unreleased Chrome versions`:\n  alpha and beta versions.\n* `last 2 major versions` or `last 2 iOS major versions`:\n  all minor/patch releases of last 2 major versions.\n* `since 2015` or `last 2 years`: all versions released since year 2015\n  (also `since 2015-03` and `since 2015-03-10`).\n* `dead`: browsers without official support or updates for 24 months.\n  Right now it is `IE 10`, `IE_Mob 10`, `BlackBerry 10`, `BlackBerry 7`,\n  `Samsung 4` and `OperaMobile 12.1`.\n* `last 2 versions`: the last 2 versions for *each* browser.\n* `last 2 Chrome versions`: the last 2 versions of Chrome browser.\n* `defaults`: Browserslist’s default browsers\n  (`> 0.5%, last 2 versions, Firefox ESR, not dead`).\n* `not ie <= 8`: exclude browsers selected by previous queries.\n\nYou can add `not ` to any query.\n\n[`caniuse-lite/data/regions`]: https://github.com/ben-eb/caniuse-lite/tree/master/data/regions\n[two-letter country code]:     https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements\n[custom usage data]:           #custom-usage-data\n[still maintained]:            https://github.com/nodejs/Release\n[Can I Use]:                   https://caniuse.com/\n\n\n### Debug\n\nRun `npx browserslist` in project directory to see what browsers was selected\nby your queries.\n\n```sh\n$ npx browserslist\nand_chr 61\nand_ff 56\nand_qq 1.2\nand_uc 11.4\nandroid 56\nbaidu 7.12\nbb 10\nchrome 62\nedge 16\nfirefox 56\nios_saf 11\nopera 48\nsafari 11\nsamsung 5\n```\n\n\n### Browsers\n\nNames are case insensitive:\n\n* `Android` for Android WebView.\n* `Baidu` for Baidu Browser.\n* `BlackBerry` or `bb` for Blackberry browser.\n* `Chrome` for Google Chrome.\n* `ChromeAndroid` or `and_chr` for Chrome for Android\n* `Edge` for Microsoft Edge.\n* `Electron` for Electron framework. It will be converted to Chrome version.\n* `Explorer` or `ie` for Internet Explorer.\n* `ExplorerMobile` or `ie_mob` for Internet Explorer Mobile.\n* `Firefox` or `ff` for Mozilla Firefox.\n* `FirefoxAndroid` or `and_ff` for Firefox for Android.\n* `iOS` or `ios_saf` for iOS Safari.\n* `Node` for Node.js.\n* `Opera` for Opera.\n* `OperaMini` or `op_mini` for Opera Mini.\n* `OperaMobile` or `op_mob` for Opera Mobile.\n* `QQAndroid` or `and_qq` for QQ Browser for Android.\n* `Safari` for desktop Safari.\n* `Samsung` for Samsung Internet.\n* `UCAndroid` or `and_uc` for UC Browser for Android.\n* `kaios` for KaiOS Browser.\n\n\n## Config File\n\n### `package.json`\n\nIf you want to reduce config files in project root, you can specify\nbrowsers in `package.json` with `browserslist` key:\n\n```json\n{\n  \"private\": true,\n  \"dependencies\": {\n    \"autoprefixer\": \"^6.5.4\"\n  },\n  \"browserslist\": [\n    \"last 1 version\",\n    \"> 1%\",\n    \"IE 10\"\n  ]\n}\n```\n\n\n### `.browserslistrc`\n\nSeparated Browserslist config should be named `.browserslistrc`\nand have browsers queries split by a new line. Comments starts with `#` symbol:\n\n```yaml\n# Browsers that we support\n\nlast 1 version\n> 1%\nIE 10 # sorry\n```\n\nBrowserslist will check config in every directory in `path`.\nSo, if tool process `app/styles/main.css`, you can put config to root,\n`app/` or `app/styles`.\n\nYou can specify direct path in `BROWSERSLIST_CONFIG` environment variables.\n\n\n## Shareable Configs\n\nYou can use the following query to reference an exported Browserslist config\nfrom another package:\n\n```json\n  \"browserslist\": [\n    \"extends browserslist-config-mycompany\"\n  ]\n```\n\nFor security reasons, external configuration only supports packages that have\nthe `browserslist-config-` prefix. npm scoped packages are also supported, by\nnaming or prefixing the module with `@scope/browserslist-config`, such as\n`@scope/browserslist-config` or `@scope/browserslist-config-mycompany`.\n\nIf you don’t accept Browserslist queries from users, you can disable the\nvalidation by using the `dangerousExtend` option:\n\n```js\nbrowserslist(queries, { path, dangerousExtend: true })\n```\n\nBecause this uses `npm`'s resolution, you can also reference specific files\nin a package:\n\n```json\n  \"browserslist\": [\n    \"extends browserslist-config-mycompany/desktop\",\n    \"extends browserslist-config-mycompany/mobile\"\n  ]\n```\n\nWhen writing a shared Browserslist package, just export an array.\n`browserslist-config-mycompany/index.js`:\n\n```js\nmodule.exports = [\n  'last 1 version',\n  '> 1%',\n  'ie 10'\n]\n```\n\n\n## Configuring for Different Environments\n\nYou can also specify different browser queries for various environments.\nBrowserslist will choose query according to `BROWSERSLIST_ENV` or `NODE_ENV`\nvariables. If none of them is declared, Browserslist will firstly look\nfor `production` queries and then use defaults.\n\nIn `package.json`:\n\n```js\n  \"browserslist\": {\n    \"production\": [\n      \"> 1%\",\n      \"ie 10\"\n    ],\n    \"modern\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\"\n    ],\n    \"ssr\": [\n      \"node 12\"\n    ]\n  }\n```\n\nIn `.browserslistrc` config:\n\n```ini\n[production]\n> 1%\nie 10\n\n[modern]\nlast 1 chrome version\nlast 1 firefox version\n\n[ssr]\nnode 12\n```\n\n\n## Custom Usage Data\n\nIf you have a website, you can query against the usage statistics of your site.\n[`browserslist-ga`] will ask access to Google Analytics and then generate\n`browserslist-stats.json`:\n\n```\nnpx browserslist-ga\n```\n\nOf course, you can generate usage statistics file by any other method.\nFile format should be like:\n\n```js\n{\n  \"ie\": {\n    \"6\": 0.01,\n    \"7\": 0.4,\n    \"8\": 1.5\n  },\n  \"chrome\": {\n    …\n  },\n  …\n}\n```\n\nNote that you can query against your custom usage data\nwhile also querying against global or regional data.\nFor example, the query `> 1% in my stats, > 5% in US, 10%` is permitted.\n\n[`browserslist-ga`]: https://github.com/browserslist/browserslist-ga\n[Can I Use]:         https://caniuse.com/\n\n\n## JS API\n\n```js\nconst browserslist = require('browserslist')\n\n// Your CSS/JS build tool code\nfunction process (source, opts) {\n  const browsers = browserslist(opts.overrideBrowserslist, {\n    stats: opts.stats,\n    path:  opts.file,\n    env:   opts.env\n  })\n  // Your code to add features for selected browsers\n}\n```\n\nQueries can be a string `\"> 1%, IE 10\"`\nor an array `['> 1%', 'IE 10']`.\n\nIf a query is missing, Browserslist will look for a config file.\nYou can provide a `path` option (that can be a file) to find the config file\nrelatively to it.\n\nOptions:\n\n* `path`: file or a directory path to look for config file. Default is `.`.\n* `env`: what environment section use from config. Default is `production`.\n* `stats`: custom usage statistics data.\n* `config`: path to config if you want to set it manually.\n* `ignoreUnknownVersions`: do not throw on direct query (like `ie 12`).\n  Default is `false.`\n* `dangerousExtend`: Disable security checks for `extend` query.\n  Default is `false.`\n* `mobileToDesktop`: Use desktop browsers if Can I Use doesn’t have data\n  about this mobile version. For instance, Browserslist will return\n  `chrome 20` on `and_chr 20` query (Can I Use has only data only about\n  latest versions of mobile browsers). Default is `false`.\n\nFor non-JS environment and debug purpose you can use CLI tool:\n\n```sh\nbrowserslist \"> 1%, IE 10\"\n```\n\nYou can get total users coverage for selected browsers by JS API:\n\n```js\nbrowserslist.coverage(browserslist('> 1%'))\n//=> 81.4\n```\n\n```js\nbrowserslist.coverage(browserslist('> 1% in US'), 'US')\n//=> 83.1\n```\n\n```js\nbrowserslist.coverage(browserslist('> 1% in my stats'), 'my stats')\n//=> 83.1\n```\n\n```js\nbrowserslist.coverage(browserslist('> 1% in my stats', { stats }), stats)\n//=> 82.2\n```\n\nOr by CLI:\n\n```sh\n$ browserslist --coverage \"> 1%\"\nThese browsers account for 81.4% of all users globally\n```\n\n```sh\n$ browserslist --coverage=US \"> 1% in US\"\nThese browsers account for 83.1% of all users in the US\n```\n\n```sh\n$ browserslist --coverage \"> 1% in my stats\"\nThese browsers account for 83.1% of all users in custom statistics\n```\n\n```sh\n$ browserslist --coverage \"> 1% in my stats\" --stats=./stats.json\nThese browsers account for 83.1% of all users in custom statistics\n```\n\n\n## Environment Variables\n\nIf some tool use Browserslist inside, you can change browsers settings\nby [environment variables]:\n\n* `BROWSERSLIST` with browsers queries.\n\n   ```sh\n  BROWSERSLIST=\"> 5%\" gulp css\n   ```\n\n* `BROWSERSLIST_CONFIG` with path to config file.\n\n   ```sh\n  BROWSERSLIST_CONFIG=./config/browserslist gulp css\n   ```\n\n* `BROWSERSLIST_ENV` with environments string.\n\n   ```sh\n  BROWSERSLIST_ENV=\"development\" gulp css\n   ```\n\n* `BROWSERSLIST_STATS` with path to the custom usage data\n  for `> 1% in my stats` query.\n\n   ```sh\n  BROWSERSLIST_STATS=./config/usage_data.json gulp css\n   ```\n\n* `BROWSERSLIST_DISABLE_CACHE` if you want to disable config reading cache.\n\n   ```sh\n  BROWSERSLIST_DISABLE_CACHE=1 gulp css\n   ```\n\n[environment variables]: https://en.wikipedia.org/wiki/Environment_variable\n\n\n## Cache\n\nBrowserslist caches the configuration it reads from `package.json` and\n`browserslist` files, as well as knowledge about the existence of files,\nfor the duration of the hosting process.\n\nTo clear these caches, use:\n\n```js\nbrowserslist.clearCaches()\n```\n\nTo disable the caching altogether, set the `BROWSERSLIST_DISABLE_CACHE`\nenvironment variable.\n\n\n## Security Contact\n\nTo report a security vulnerability, please use the [Tidelift security contact].\nTidelift will coordinate the fix and disclosure.\n\n[Tidelift security contact]: https://tidelift.com/security\n",
    "licenseText": "The MIT License (MIT)\n\nCopyright 2014 Andrey Sitnik <andrey@sitnik.ru>\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n"
  },
  "artifacts": [],
  "remote": {
    "resolved": "https://registry.yarnpkg.com/browserslist/-/browserslist-4.6.6.tgz#6e4bf467cde520bc9dbdf3747dafa03531cec453",
    "type": "tarball",
    "reference": "https://registry.yarnpkg.com/browserslist/-/browserslist-4.6.6.tgz",
    "hash": "6e4bf467cde520bc9dbdf3747dafa03531cec453",
    "registry": "npm",
    "packageName": "browserslist"
  },
  "registry": "npm",
  "hash": "6e4bf467cde520bc9dbdf3747dafa03531cec453"
}

Any idea who's generating these integrity fields and when, and why the two versions of this package (npm-browserslist-4.6.3-0530cbc6ab0c1f3fc8c819c72377ba55cf647f05 and npm-browserslist-4.7.0-9ee89225ffc07db03409f2fee524dc8227458a17) have it while the middle version (npm-browserslist-4.6.6-6e4bf467cde520bc9dbdf3747dafa03531cec453) does not?

This made all of our Jenkins builds to fail since the 1.19.0 update. To get it working we had to revert to 1.18.0.

ClaudiuCudla commented 5 years ago

The code at https://github.com/yarnpkg/yarn/compare/1.18-stable...v1.19.0#diff-7246848d5d10d9c48ef4be28cb961582R24 (https://github.com/yarnpkg/yarn/blob/master/src/package-fetcher.js#L24) is trhowing an error if the cacheRemote.integrity property isn't there, but I think it should just move forward if it's not found. Or as @danechitoaie asked, is there a way to have yarn generate the cacheRemote integrity values for these packages that are missing it?

drewlustro commented 5 years ago

I just ran into this today too. No idea how to fix it.

I've tried:

yarn cache clean
rm -rf $(yarn cache dir)
yarn install --no-cache
yarn install --no-cache --network-concurrency 1
drewlustro commented 5 years ago

In case anyone was wondering how to rollback to yarn@1.17.3 with homebrew, as it isn't well documented:

brew unlink yarn
brew install https://raw.githubusercontent.com/dotiful/homebrew-core/2815d3ce3ea17202979f062bbcae78c96ebc0723/Formula/yarn.rb
brew switch yarn 1.17.3
ClaudiuCudla commented 5 years ago

I just ran into this today too. No idea how to fix it.

I've tried:

yarn cache clean
rm -rf $(yarn cache dir)
yarn install --no-cache
yarn install --no-cache --network-concurrency 1

Also tried all of the above - and for some projects it works. Then, because we use Yarn on a shared instance that runs multiple installs with Yarn on a global level, the cache runs into a repository that has no property with the 'integrity' value and it fails. The fix should be either to:

Blasz commented 5 years ago

You can follow the steps in https://github.com/yarnpkg/yarn/issues/7584#issuecomment-536437423:

The solution is to first enable the migration by adding the following in ~/.yarnrc:

unsafe-disable-integrity-migration false

Then cleaning the cache and reinstalling:

yarn cache clean
yarn install -f

There is a partial fix in the latest nightly build of yarn but there are still lingering issues so I'd follow #7584 for further updates.

arcanis commented 5 years ago

Closing to keep a single thread 🙂 : https://github.com/yarnpkg/yarn/issues/7584#issuecomment-536437423