Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Failed to load plugin import: 'eslint-plugin-import'

I'm new to react. I'm following the tutorial steps installing node. However, when I run npm start, errors keep show up.

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

Also, I tried to install 'eslint-plugin-import', but in vain...

npm install eslint-plugin-import -g  npm WARN [email protected] requires a peer of [email protected] - 4.x but none was installed.  + [email protected] 

System info

eslint --version v4.2.0  npm -v 5.2.0  npm list -g | grep eslint ├─┬ [email protected] │ ├─┬ [email protected] ├─┬ [email protected] │ ├─┬ [email protected] │ ├─┬ [email protected] ├─┬ [email protected] 
like image 781
Willjay Avatar asked Jul 13 '17 07:07

Willjay


People also ask

What does ESLint plugin Import do?

This plugin intends to support linting of ES2015+ (ES6+) import/export syntax, and prevent issues with misspelling of file paths and import names. All the goodness that the ES2015+ static module syntax intends to provide, marked up in your editor.

What is ESLint plugin in node?

eslint-plugin-node follows semantic versioning and ESLint's Semantic Versioning Policy. Patch release (intended to not break your lint build) A bug fix in a rule that results in it reporting fewer errors.

How do I install ESLint locally?

If you haven't installed ESLint either locally or globally do so by running npm install eslint in the workspace folder for a local install or npm install -g eslint for a global install. On new folders you might also need to create a . eslintrc configuration file.


Video Answer


1 Answers

The issue is resolved for me after installing the following in a row:

npm install eslint-plugin-import eslint-plugin-flowtype eslint-plugin-jsx-a11y eslint-plugin-react 

Have you tried installing eslint locally, like

npm install eslint-plugin-import --save-dev 

?

Edit -Solution:

Instead of installing eslint packages one after another, the problem can be alleviated by

npm install react-scripts 

as react-scripts is taking care of webpack, babel and eslint and the dependencies thereof.

This may avoid conflicts, as in your case.

like image 88
Bussller Avatar answered Sep 24 '22 16:09

Bussller