Berry: [Bug] Resolve error: unable to load resolver "node" import/named with ESLint configured

Created on 1 Jun 2020  路  1Comment  路  Source: yarnpkg/berry

  • [ ] I'd be willing to implement a fix

Describe the bug

I try to use Yarn 2 together with ESLint and Prettier, but I get this error:

Resolve error: unable to load resolver "node" import/named
Resolve error: unable to load resolver "node" import/no-extraneous-dependencies
(and five more errors)

To Reproduce

Clone this git repository: https://github.com/IT-CASADO/yarn-eslint/tree/yarn-v2
(master branch contains the same configuration with Yarn 1)

Execute following command: yarn eslint ./src/.

Environment if relevant (please complete the following information):

  • OS: [Windows]
  • Node version [12.17.0]
  • Yarn version [2.0.0-rc.33]

Additional context

I followed this steps here:

I'm assuming no configuration errors with ESLint, because it is working with Yarn 1.
Do I miss something special for Yarn 2?

bug

Most helpful comment

Yarn 2 is stricter - see https://next.yarnpkg.com/features/pnp#pnp-loose-mode

Enabling loose mode temporarily and running outputs:

(node:34285) [MODULE_NOT_FOUND] Error: eslint-module-utils tried to access eslint-import-resolver-node, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound.

Resolve by adding a hint to .yarnrc.yml

packageExtensions:
  eslint-module-utils@*:
    dependencies:
      eslint-import-resolver-node: "*"

>All comments

Yarn 2 is stricter - see https://next.yarnpkg.com/features/pnp#pnp-loose-mode

Enabling loose mode temporarily and running outputs:

(node:34285) [MODULE_NOT_FOUND] Error: eslint-module-utils tried to access eslint-import-resolver-node, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound.

Resolve by adding a hint to .yarnrc.yml

packageExtensions:
  eslint-module-utils@*:
    dependencies:
      eslint-import-resolver-node: "*"
Was this page helpful?
0 / 5 - 0 ratings

Related issues

dzintars picture dzintars  路  3Comments

danreg picture danreg  路  3Comments

Santas picture Santas  路  3Comments

chrisands picture chrisands  路  3Comments

larixer picture larixer  路  4Comments