question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot find module 'eslint-plugin-import'

See original GitHub issue

Tell us about your environment

Node version: v10.16.3 npm version: v6.13.1 Local ESLint version: v6.7.1 Global ESLint version: Not found

What parser (default, Babel-ESLint, etc.) are you using? eslint-config-airbnb-base

Please show your full configuration:

module.exports = {
  env: {
    browser: true,
    es6: true,
    node: true,
  },
  extends: [
    'airbnb-base',
  ],
  globals: {
    Atomics: 'readonly',
    SharedArrayBuffer: 'readonly',
  },
  parserOptions: {
    ecmaVersion: 2018,
    sourceType: 'module',
  },
  rules: {
  },
};

What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.

const test = 's';
./node_modules/.bin/eslint --init (Then it automatically starts I believe via the extension or something.)

What did you expect to happen? For eslint to start linting.

What actually happened? Please include the actual, raw output from ESLint. I’ve been encountering this issue while trying to setup eslint with airbnb. Using this npx package. https://www.npmjs.com/package/eslint-config-airbnb-base

ESlint output

Failed to load plugin 'import' declared in 'server\.eslintrc.js » eslint-config-airbnb-base » Z:\Development\JS\Nuxt-Test-App\zuka-ma-shlong\server\node_modules\eslint-config-airbnb-base\rules\imports.js': Cannot find module 'eslint-plugin-import'

package.json

{
  "name": "server",
  "version": "1.0.0",
  "description": "",
  "main": "app.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "cors": "^2.8.5",
    "eslint": "6.1.0",
    "eslint-config-airbnb-base": "14.0.0",
    "eslint-plugin-import": "^2.18.2",
    "express": "^4.17.1"
  }
}

.eslintrc.js

module.exports = {
  env: {
    browser: true,
    commonjs: true,
    es6: true,
    node: true,
  },
  extends: [
    'airbnb-base',
  ],
  globals: {
    Atomics: 'readonly',
    SharedArrayBuffer: 'readonly',
  },
  parserOptions: {
    ecmaVersion: 2018,
  },
  rules: {
  },
};

eslint-plugin-import is however installed locally aswell as eslint.

I’ve attempted installing the package with yarn which also didn’t seem to work either. Issue link

At this point I’ve ran out of ideas to get this working.

Are you willing to submit a pull request to fix this bug? No.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
aladdin-addcommented, Nov 30, 2019

emm… not sure what happened – I was not able to repro it.

Local ESLint version: v6.7.1

just noticed the eslint v6.7.1 in OP, but actual insalled eslint v6.1.0. can you retry to make a clean install:

$ rm -rf node_modules package-lock.json
$ npm i
1reaction
Rotinxcommented, Nov 30, 2019

so weird I appreciate your help.

Read more comments on GitHub >

github_iconTop Results From Across the Web

node.js - Failed to load plugin import: 'eslint-plugin-import'
The issue is resolved for me after installing the following in a row: npm install eslint-plugin-import eslint-plugin-flowtype ...
Read more >
Cannot find module 'eslint-plugin-import' · Issue #2141 - GitHub
I've been encountering this issue while trying to setup eslint with airbnb.
Read more >
eslint-plugin-import - npm
Start using eslint-plugin-import in your project by running `npm i ... import x from 'module' should look to find the file behind module...
Read more >
eslint/eslint - Gitter
Failed to load plugin 'import' declared in 'BaseConfig » /Projects/pc/node_modules/eslint-config-react-app/index.js': Cannot find module 'eslint'.
Read more >
eslint-plugin-import-helpers - npm package - Snyk
The npm package eslint-plugin-import-helpers was scanned for known vulnerabilities and missing license, and no issues were found. Thus the package was deemed as ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found