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

Error: Failed to load plugin import: Cannot find module 'eslint-plugin-import' #6391

Closed
tmclayson opened this issue Feb 10, 2019 · 4 comments

Comments

@tmclayson
Copy link

tmclayson commented Feb 10, 2019

Is this a bug report?

Yes

Repo demonstrating the problem. It is a a freshly bootstrapped react app. I then installed react-testing-library. The same problem shows if I install enzyme instead.

https://github.com/tmclayson/create-react-app-eslint-plugin-import-error

Yes, tried deleting node_module and package-lock.json.

npm version: 6.8.0-next.2

Have tried multiple different versions however.

Which terms did you search for in User Guide?

I read the Test Utilities page, but the both the both suggestions for enzyme and react-testing-library failed for me. I've tried installing the package individually, but then something else is missing.

Environment

System:
OS: Windows 10
CPU: x64 Intel(R) Core(TM) i5-6600K CPU @ 3.50GHz
Binaries:
Yarn: 1.13.0 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 6.8.0-next.2 - C:\Program Files\nodejs\npm.CMD
Browsers:
Edge: 42.17134.1.0
npmPackages:
react: ^16.8.1 => 16.8.1
react-dom: ^16.8.1 => 16.8.1
react-scripts: 2.1.3 => 2.1.3
npmGlobalPackages:
create-react-app: Not Found

Steps to Reproduce

  1. npx create-react-app testing
  2. npm install --save-dev react-testing-library
  3. npm start

Expected Behavior

Compile and load the base react app without issues.

Actual Behavior

Starting the development server...
Failed to compile.

./src/index.js
Error: Failed to load plugin import: Cannot find module 'eslint-plugin-import'
Referenced from:
at Array.forEach ()
at Array.reduceRight ()

Reproducible Demo

https://github.com/tmclayson/create-react-app-eslint-plugin-import-error

npm start

@petetnt
Copy link
Contributor

petetnt commented Feb 10, 2019

Hi @tmclayson,

from a quick CodeSandbox test everything seemed to work normally: https://codesandbox.io/s/lxpwjno9r7

Sounds like a intermittent issue with npm . Have you tried cleaning the cache?

@ghost
Copy link

ghost commented Feb 20, 2019

I met the same problem on my MacOS and I fixed it by removing node_modules and reinstall all the packages.

@tmclayson
Copy link
Author

Using yarn to manage everything instead of npm solved the issue for me.

@ghost
Copy link

ghost commented Feb 28, 2019

Great, Yarn works for me too.

@lock lock bot locked and limited conversation to collaborators Mar 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants