yarn check fails with valid yarn.lock and node_modules

Created on 1 Jul 2019  路  2Comments  路  Source: yarnpkg/yarn

Do you want to request a feature or report a bug?

Report a bug.

What is the current behavior?

After a fresh install (with specific package versions) yarn check fails with the error: "acorn" is wrong version: expected "2.7.0", got "6.1.1".

The issue appears to be that this specific version of [email protected] expects acorn@^2.4.0 but [email protected] expects acorn@^6.0.5 and [email protected] expects ^6.0.7.

package.json

{
  "dependencies": {
    "jsdom": "7.2.2",
    "webpack": "4.33.0",
    "webpack-bundle-analyzer": "3.3.2"
  }
}

snippet of relevant yarn.lock

acorn@^2.1.0, acorn@^2.4.0:
  version "2.7.0"
  resolved "https://registry.yarnpkg.com/acorn/-/acorn-2.7.0.tgz#ab6e7d9d886aaca8b085bc3312b79a198433f0e7"
  integrity sha1-q259nYhqrKiwhbwzEreaGYQz8Oc=

acorn@^6.0.5, acorn@^6.0.7:
  version "6.1.1"
  resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.1.1.tgz#7d25ae05bb8ad1f9b699108e1094ecd7884adc1f"
  integrity sha512-jPTiwtOxaHNaAPg/dmrJ/beuzLRnXtB0kQPQ8JpotKJgTB6rX6c8mlf315941pyjBSaPg8NHXS9fhP4u17DpGA==

snippet of installed packages in node_modules

> cat node_modules/webpack/package.json | grep version
  "version": "4.33.0",
> cat node_modules/webpack-bundle-analyzer/package.json | grep version
  "version": "3.3.2",
> cat node_modules/acorn/package.json | grep version
  "version": "6.1.1",
> cat node_modules/jsdom/package.json | grep version
  "version": "7.2.2",
> cat node_modules/jsdom/node_modules/acorn/package.json | grep version
  "version": "2.7.0",

If the current behavior is a bug, please provide the steps to reproduce.

Steps

> yarn init
> yarn add [email protected] [email protected] [email protected]
> yarn check
yarn check v1.16.0
error "acorn" is wrong version: expected "2.7.0", got "6.1.1"
error "webpack#acorn" not installed
error "webpack-bundle-analyzer#acorn" not installed
error "webpack#acorn-dynamic-import" not installed
warning "chokidar#fsevents#node-pre-gyp@^0.12.0" could be deduped from "0.12.0" to "[email protected]"
error Found 4 errors.
info Visit https://yarnpkg.com/en/docs/cli/check for documentation about this command.

What is the expected behavior?

yarn check passes with no errors since both versions of acorn is installed to satisfy package dependencies.

Please mention your node.js, yarn and operating system version.

yarn version: 1.16.0
node version: 10.8.0
OS: macOS 10.13.6

Most helpful comment

Found this issue when searching for:

warning "chokidar#fsevents#node-pre-gyp@^0.12.0" could be deduped from "0.12.0" to "[email protected]"

I can't get that warning to go away despite having having only version of node-pre-gyp in my yarn.lock.

All 2 comments

Found this issue when searching for:

warning "chokidar#fsevents#node-pre-gyp@^0.12.0" could be deduped from "0.12.0" to "[email protected]"

I can't get that warning to go away despite having having only version of node-pre-gyp in my yarn.lock.

Seeing the same out of the box on https://github.com/STRML/react-resizable/tree/v1.10.1.

Was this page helpful?
0 / 5 - 0 ratings