Cannot find module 'eslint-plugin-import'
See original GitHub issueTell 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:
- Created 4 years ago
- Comments:10 (4 by maintainers)
Top GitHub Comments
emm… not sure what happened – I was not able to repro it.
just noticed the eslint v6.7.1 in OP, but actual insalled eslint v6.1.0. can you retry to make a clean install:
so weird I appreciate your help.