Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to load plugin 'import' #2251

Closed
ext opened this issue Oct 10, 2021 · 7 comments
Closed

Failed to load plugin 'import' #2251

ext opened this issue Oct 10, 2021 · 7 comments

Comments

@ext
Copy link

ext commented Oct 10, 2021

With the latest eslint@8 release I run into the following issue:

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Failed to load plugin 'import' declared in '.eslintrc.json » [...]': Package subpath './lib/util/glob-util' is not defined by "exports" in [...]

@ljharb
Copy link
Member

ljharb commented Oct 10, 2021

That’s expected; this package is not yet compatible with eslint v8. npm 7+ will refuse to install the two together; I suggest upgrading to it.

Duplicate of #2211.

@ljharb ljharb closed this as completed Oct 10, 2021
@ext
Copy link
Author

ext commented Oct 10, 2021

@ljharb Eh, I'm running npm 8 and all I get is a tiny warning:

npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '[...]',
npm WARN EBADENGINE   required: { node: '>= 14.17', npm: '^7' },
npm WARN EBADENGINE   current: { node: 'v16.9.1', npm: '8.0.0' }
npm WARN EBADENGINE }

Technically I understand but since it is just a warning it also prevent automated tools such as renovate from failing for the proper reason,

@ljharb
Copy link
Member

ljharb commented Oct 11, 2021

Not engine - that’s coming from your own app - but peer deps. Perhaps you’ve enabled the legacy peer deps setting?

@ext
Copy link
Author

ext commented Oct 11, 2021

No, I have not enabled legacy-peer-deps and I'm not getting anyother error or warning except the one from eslint when I try to run it. I understand it is not supported yet but other than engine I see no warning or error.

@ljharb
Copy link
Member

ljharb commented Oct 11, 2021

What does npm config get legacy-peer-deps say? It can be set by an env var or by an .npmrc file.

what does npm ls say? If that exits nonzero, your dep graph is invalid and you can’t expect anything to work.

@ext
Copy link
Author

ext commented Oct 11, 2021

What does npm config get legacy-peer-deps say? It can be set by an env var or by an .npmrc file.

$ npm config get legacy-peer-deps
false

what does npm ls say? If that exits nonzero, your dep graph is invalid and you can’t expect anything to work.

$ npm ls eslint
[...]
    └── eslint@8.0.0 deduped invalid: "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0" from node_modules/eslint-plugin-import

So it is invalid, I would have expected npm install to inform me of this.

@ljharb
Copy link
Member

ljharb commented Oct 11, 2021

I also would have; it’d be great if you filed a bug on npm/cli about this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants