eslint-plugin-import: Cannot find module eslint-module-utils/visit after updating to v2.25.1

I had previously eslint-plugin-import@2.24.2. When updating to v2.25.1, I’m getting the following error:


Syntax Error: Thread Loader (Worker 0)
Failed to load plugin 'import' declared in '.eslintrc.json': Cannot find module 'eslint-module-utils/visit'
Require stack:
- /code/node_modules/eslint-plugin-import/lib/ExportMap.js
- /code/node_modules/eslint-plugin-import/lib/rules/named.js
- /code/node_modules/eslint-plugin-import/lib/index.js
- /code/node_modules/@eslint/eslintrc/lib/config-array-factory.js
- /code/node_modules/@eslint/eslintrc/lib/index.js
- /code/node_modules/eslint/lib/cli-engine/cli-engine.js
- /code/node_modules/eslint/lib/cli-engine/index.js
- /code/node_modules/eslint/lib/api.js
- /code/node_modules/eslint-loader/index.js
- /code/node_modules/loader-runner/lib/loadLoader.js
- /code/node_modules/loader-runner/lib/LoaderRunner.js
- /code/node_modules/thread-loader/dist/worker.js

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 44
  • Comments: 23 (12 by maintainers)

Commits related to this issue

Most upvoted comments

v2.25.2 is published.

@ljharb Allright then I will close my PR, because I don’t know how I can fix this issue 😃

Yes, there’s two open PRs already to do that. I’m waiting on something from one of them, and then I’ll cut a patch release.

In the meantime, it’s trivial for anyone to fix this by upgrading eslint-module-utils in their lockfile.

I have updated ^2.6.2 to ~2.7.0 in my PR (#2257) , so I think 2.6.2 won’t be valid in any lockfile now. I think the problem with ^2.7.0 is, that 2.6.2 is still a valid version.

I’m using yarn, adding yarn add -D eslint-module-utils fixing the crashing vscode extension host, but now I’m seeing Cannot read property 'body' of undefined Occurred while linting file.. errors in vscode problem Eslint output. PS I’m using eslint 7.32.0, cos updating to 8 has issues with eslint-plugin-next, and I guess multiple other plugins, but nextjs is crashing extension host first.

reverting back to 2.24.2 fixes an issue.